1
# $Id: testing.mak,v 1.15 2006/05/29 01:29:00 darren Exp $
3
# Copyright (c) 1996-2002, Darren Hiebert
5
# Development makefile for Exuberant Ctags, used to build releases.
10
TEST_OPTIONS = -nu --c-kinds=+lpx
12
DIFF_OPTIONS = -U 0 -I '^!_TAG'
13
DIFF = if diff $(DIFF_OPTIONS) tags.ref tags.test > $(DIFF_FILE); then \
14
rm -f tags.ref tags.test $(DIFF_FILE) ; \
17
echo "FAILED: differences left in $(DIFF_FILE)" ; \
20
.PHONY: test test.include test.fields test.extra test.linedir test.etags test.eiffel test.linux
22
test: test.include test.fields test.extra test.linedir test.etags test.eiffel test.linux
24
test.%: DIFF_FILE = $@.diff
26
REF_INCLUDE_OPTIONS = $(TEST_OPTIONS) --format=1
27
TEST_INCLUDE_OPTIONS = $(TEST_OPTIONS) --format=1
28
test.include: $(CTAGS_TEST) $(CTAGS_REF)
29
@ echo -n "Testing tag inclusion..."
30
@ $(CTAGS_REF) -R $(REF_INCLUDE_OPTIONS) -o tags.ref Test
31
@ $(CTAGS_TEST) -R $(TEST_INCLUDE_OPTIONS) -o tags.test Test
34
REF_FIELD_OPTIONS = $(TEST_OPTIONS) --fields=+afmikKlnsSz
35
TEST_FIELD_OPTIONS = $(TEST_OPTIONS) --fields=+afmikKlnsStz
36
test.fields: $(CTAGS_TEST) $(CTAGS_REF)
37
@ echo -n "Testing extension fields..."
38
@ $(CTAGS_REF) -R $(REF_FIELD_OPTIONS) -o tags.ref Test
39
@ $(CTAGS_TEST) -R $(TEST_FIELD_OPTIONS) -o tags.test Test
42
REF_EXTRA_OPTIONS = $(TEST_OPTIONS) --extra=+fq --format=1
43
TEST_EXTRA_OPTIONS = $(TEST_OPTIONS) --extra=+fq --format=1
44
test.extra: $(CTAGS_TEST) $(CTAGS_REF)
45
@ echo -n "Testing extra tags..."
46
@ $(CTAGS_REF) -R $(REF_EXTRA_OPTIONS) -o tags.ref Test
47
@ $(CTAGS_TEST) -R $(TEST_EXTRA_OPTIONS) -o tags.test Test
50
REF_LINEDIR_OPTIONS = $(TEST_OPTIONS) --line-directives -n
51
TEST_LINEDIR_OPTIONS = $(TEST_OPTIONS) --line-directives -n
52
test.linedir: $(CTAGS_TEST) $(CTAGS_REF)
53
@ echo -n "Testing line directives..."
54
@ $(CTAGS_REF) $(REF_LINEDIR_OPTIONS) -o tags.ref Test/line_directives.c
55
@ $(CTAGS_TEST) $(TEST_LINEDIR_OPTIONS) -o tags.test Test/line_directives.c
58
REF_ETAGS_OPTIONS = -e
59
TEST_ETAGS_OPTIONS = -e
60
test.etags: $(CTAGS_TEST) $(CTAGS_REF)
61
@ echo -n "Testing TAGS output..."
62
@ $(CTAGS_REF) -R $(REF_ETAGS_OPTIONS) -o tags.ref Test
63
@ $(CTAGS_TEST) -R $(TEST_ETAGS_OPTIONS) -o tags.test Test
66
REF_EIFFEL_OPTIONS = $(TEST_OPTIONS) --format=1 --languages=eiffel
67
TEST_EIFFEL_OPTIONS = $(TEST_OPTIONS) --format=1 --languages=eiffel
68
EIFFEL_DIRECTORY = $(ISE_EIFFEL)/library
69
test.eiffel: $(CTAGS_TEST) $(CTAGS_REF)
70
@ echo -n "Testing Eiffel tag inclusion..."
71
@ $(CTAGS_REF) -R $(REF_EIFFEL_OPTIONS) -o tags.ref $(EIFFEL_DIRECTORY)
72
@ $(CTAGS_TEST) -R $(TEST_EIFFEL_OPTIONS) -o tags.test $(EIFFEL_DIRECTORY)
75
REF_LINUX_OPTIONS = $(TEST_OPTIONS) --fields=k
76
TEST_LINUX_OPTIONS = $(TEST_OPTIONS) --fields=k
77
LINUX_DIRECTORY := $(shell ls -dtr /usr/src/kernels/* | tail -1)
78
test.linux: $(CTAGS_TEST) $(CTAGS_REF)
79
@ echo -n "Testing Linux tag inclusion..."
80
@ $(CTAGS_REF) -R $(REF_LINUX_OPTIONS) -o tags.ref $(LINUX_DIRECTORY)
81
@ $(CTAGS_TEST) -R $(TEST_LINUX_OPTIONS) -o tags.test $(LINUX_DIRECTORY)
84
TEST_ARTIFACTS = test.*.diff tags.ref tags.test
87
rm -f $(TEST_ARTIFACTS)