1 # scan the L4 global configuration file
3 #include $(L4DIR)/mk/Makeconf
5 TOOL = ../src/preprocess
9 ALL_TESTS = $(TOOL_TESTS)
10 TOOL_TESTS = mapping mapping_inline random random_inline extern_c static \
11 noinline explicit operator template template_inline c-preproc \
12 inline inline_noinline \
13 parser parser_noinline \
14 multifile variable line line_not line_nh interface comment_in_string \
15 default_args drop_single1 drop_single2 drop_single3 drop_multi1 \
16 drop_multi2 implement_template
18 mapping_inline_src = mapping
19 mapping_inline_flags = -i
21 random_inline_src = random
22 random_inline_flags = -i
28 inline_noinline_src = inline
29 inline_noinline_flags =
33 template_inline_src = template
34 template_inline_flags = -i
38 parser_noinline_src = parser
39 parser_noinline_flags =
41 multifile_src = multifile1 multifile2
43 multifile_extra = multifile-part1.cc multifile-part2.cc
51 interface_missing = interface.h
52 interface_extra = interfacepublic.h
54 drop_single1_src = dropsection
55 drop_single1_flags = -s -e "bax"
57 drop_single2_src = dropsection
58 drop_single2_flags = -s -e "bax ixbix"
60 drop_single3_src = dropsection
61 drop_single3_flags = -s -e "bax aba"
63 drop_multi1_src = dropsection dropsection-ext
64 drop_multi1_flags = -s -e "bax aba"
65 drop_multi1_extra = drop_multi1-ext.cc
67 drop_multi2_src = dropsection dropsection-ext
68 drop_multi2_flags = -s -e "bax aba ext"
69 drop_multi2_extra = drop_multi2-ext.cc
72 ifdef_flags = -s -e "true"
75 ifdef1_flags = -s -e "true"
76 ifdef1_extra = ifdef1-more.cpp
78 random.cpp: combine.pl
87 for test in $(TOOL_TESTS); \
89 echo "ifndef $${test}_src" >> $@.new; \
90 echo "$${test}_src = $${test}" >> $@.new; \
91 echo "endif" >> $@.new; \
92 echo "ifndef $${test}_flags" >> $@.new; \
93 echo "$${test}_flags = " >> $@.new; \
94 echo "endif" >> $@.new; \
95 echo "$${test}.cc: \$$(addsuffix .cpp, \$$($${test}_src)) \$$(TOOL); \$$(TOOL) \$$($${test}_flags) -c $${test} \$$(filter-out \$$(TOOL), \$$^)" >> $@.new; \
102 rm -f $(addsuffix .cc, $(TOOL_TESTS)) \
103 $(addsuffix .h, $(TOOL_TESTS)) \
104 $(addsuffix _i.h, $(TOOL_TESTS))
107 test: $(addsuffix .t.ok, $(ALL_TESTS))
110 @echo -n "Running test $* ... "
111 ifeq ($(RECREATE_OUTPUT),1)
112 @cp $(filter-out $($*_missing),$*.h $*_i.h $*.cc) $($*_extra) verify/
114 @for i in $(filter-out $($*_missing),$*.h $*_i.h $*.cc) $($*_extra); \
116 diff -u verify $$i || exit 1; \
123 $(MAKE) test RECREATE_OUTPUT=1
126 @echo Not installing tests.
129 $(RM) $(ALL) $(OBJS) *.t.ok
132 $(RM) *~ .*.d test_rules