Routino SVN Repository Browser

Check out the latest version of Routino: svn co http://routino.org/svn/trunk routino

ViewVC logotype

Contents of /trunk/src/test/Makefile

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1699 - (show annotations) (download)
Tue Jun 9 18:05:06 2015 UTC (9 years, 9 months ago) by amb
File size: 3456 byte(s)
Merge the MS-Windows branch back into the trunk.
Code changes and documentation for Cygwin and MinGW compilers.

1 # Test cases Makefile
2 #
3 # Part of the Routino routing software.
4 #
5 # This file Copyright 2011-2015 Andrew M. Bishop
6 #
7 # This program is free software: you can redistribute it and/or modify
8 # it under the terms of the GNU Affero General Public License as published by
9 # the Free Software Foundation, either version 3 of the License, or
10 # (at your option) any later version.
11 #
12 # This program is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 # GNU Affero General Public License for more details.
16 #
17 # You should have received a copy of the GNU Affero General Public License
18 # along with this program. If not, see <http://www.gnu.org/licenses/>.
19 #
20
21 # All configuration is in the top-level Makefile.conf
22
23 include ../../Makefile.conf
24
25 # executables
26
27 ROUTINO_EXE=../planetsplitter ../planetsplitter-slim \
28 ../router ../router-slim \
29 ../filedumper ../filedumper-slim
30
31 EXE=is-fast-math
32
33 # Compilation targets
34
35 O=$(notdir $(wildcard *.osm))
36 S=$(foreach f,$(O),$(addsuffix .sh,$(basename $f)))
37
38 ########
39
40 all :
41
42 ########
43
44 test : $(ROUTINO_EXE) $(EXE)
45 @status=true ;\
46 echo ""; \
47 ./is-fast-math message; \
48 for script in $(S); do \
49 echo "" ;\
50 echo "Testing: $$script (non-slim, no pruning) ... " ;\
51 if ./$$script fat; then echo "... passed"; else echo "... FAILED"; status=false; fi ;\
52 done ;\
53 for script in $(S); do \
54 echo "" ;\
55 echo "Testing: $$script (slim, no pruning) ... " ;\
56 if ./$$script slim; then echo "... passed"; else echo "... FAILED"; status=false; fi ;\
57 done ;\
58 echo "" ;\
59 if $$status; then echo "Success: all tests passed"; else echo "Warning: Some tests FAILED"; fi ;\
60 $$status || exit 1 ;\
61 echo "" ;\
62 echo "Comparing: slim and non-slim results ... " ;\
63 if diff -q -r slim fat; then echo "... matched"; else echo "... match FAILED"; status=false; fi ;\
64 echo "" ;\
65 if $$status; then echo "Success: slim and non-slim results match"; else echo "Warning: slim and non-slim results are different - FAILED"; fi ;\
66 for script in $(S); do \
67 echo "" ;\
68 echo "Testing: $$script (non-slim, pruning) ... " ;\
69 if ./$$script fat prune; then echo "... passed"; else echo "... FAILED"; status=false; fi ;\
70 done ;\
71 for script in $(S); do \
72 echo "" ;\
73 echo "Testing: $$script (slim, pruning) ... " ;\
74 if ./$$script slim prune; then echo "... passed"; else echo "... FAILED"; status=false; fi ;\
75 done ;\
76 echo "" ;\
77 if $$status; then echo "Success: all tests passed"; else echo "Warning: Some tests FAILED"; fi ;\
78 $$status || exit 1 ;\
79 echo "" ;\
80 echo "Comparing: slim and non-slim results ... " ;\
81 if diff -q -r slim-pruned fat-pruned; then echo "... matched"; else echo "... match FAILED"; status=false; fi ;\
82 echo "" ;\
83 if $$status; then echo "Success: slim and non-slim results match"; else echo "Warning: slim and non-slim results are different - FAILED"; fi ;\
84 $$status
85
86 ########
87
88 $(ROUTINO_EXE) ::
89 cd .. && $(MAKE) $(notdir $@)
90
91 is-fast-math : is-fast-math.o
92 $(LD) $< -o $@ $(LDFLAGS)
93
94 is-fast-math.o : is-fast-math.c
95 $(CC) -c $(CFLAGS) $< -o $@
96
97 ########
98
99 install:
100
101 ########
102
103 clean:
104 rm -rf fat
105 rm -rf slim
106 rm -rf fat-pruned
107 rm -rf slim-pruned
108 rm -f *.log
109 rm -f *~
110 rm -f *.o
111 rm -f $(EXE) *.exe
112 rm -f core
113 rm -f *.gcda *.gcno *.gcov gmon.out
114
115 ########
116
117 distclean: clean
118
119 ########
120
121 .PHONY:: all test install clean distclean