Routino SVN Repository Browser

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

ViewVC logotype

Annotation of /branches/libroutino/src/test/Makefile

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1700 - (hide annotations) (download)
Tue Jun 9 18:10:45 2015 UTC (9 years, 9 months ago) by amb
File size: 3456 byte(s)
Create a branch for a version that can be compiled into a library.
1 amb 691 # Test cases Makefile
2     #
3     # Part of the Routino routing software.
4     #
5 amb 1690 # This file Copyright 2011-2015 Andrew M. Bishop
6 amb 691 #
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 amb 1343 # All configuration is in the top-level Makefile.conf
22    
23     include ../../Makefile.conf
24    
25 amb 1528 # executables
26 amb 691
27 amb 1528 ROUTINO_EXE=../planetsplitter ../planetsplitter-slim \
28     ../router ../router-slim \
29     ../filedumper ../filedumper-slim
30 amb 691
31 amb 1528 EXE=is-fast-math
32    
33 amb 691 # 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 amb 1528 test : $(ROUTINO_EXE) $(EXE)
45 amb 691 @status=true ;\
46 amb 1388 echo ""; \
47     ./is-fast-math message; \
48 amb 691 for script in $(S); do \
49     echo "" ;\
50 amb 975 echo "Testing: $$script (non-slim, no pruning) ... " ;\
51 amb 691 if ./$$script fat; then echo "... passed"; else echo "... FAILED"; status=false; fi ;\
52     done ;\
53     for script in $(S); do \
54     echo "" ;\
55 amb 1059 echo "Testing: $$script (slim, no pruning) ... " ;\
56 amb 691 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 amb 709 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 amb 975 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 amb 691 $$status
85    
86     ########
87    
88 amb 1541 $(ROUTINO_EXE) ::
89 amb 1528 cd .. && $(MAKE) $(notdir $@)
90    
91 amb 1388 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 amb 1528 install:
100    
101     ########
102    
103 amb 691 clean:
104 amb 975 rm -rf fat
105 amb 691 rm -rf slim
106 amb 975 rm -rf fat-pruned
107     rm -rf slim-pruned
108 amb 739 rm -f *.log
109 amb 1045 rm -f *~
110 amb 1388 rm -f *.o
111 amb 1699 rm -f $(EXE) *.exe
112 amb 739 rm -f core
113 amb 1045 rm -f *.gcda *.gcno *.gcov gmon.out
114 amb 691
115     ########
116    
117     distclean: clean
118 amb 913
119     ########
120    
121 amb 1528 .PHONY:: all test install clean distclean