Check out the latest version of Routino: svn co http://routino.org/svn/trunk routino
Annotation of /trunk/src/test/Makefile
Parent Directory
|
Revision Log
Revision 1388 -
(hide annotations)
(download)
Thu Jun 6 18:19:10 2013 UTC (11 years, 9 months ago) by amb
File size: 3412 byte(s)
Thu Jun 6 18:19:10 2013 UTC (11 years, 9 months ago) by amb
File size: 3412 byte(s)
When compiled with -ffast-math don't expect the results to match exactly, display the differences.
1 | amb | 691 | # Test cases Makefile |
2 | # | ||
3 | # Part of the Routino routing software. | ||
4 | # | ||
5 | amb | 1343 | # This file Copyright 2011-2013 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 | 691 | # Routino executables |
26 | |||
27 | EXE=../planetsplitter ../planetsplitter-slim \ | ||
28 | ../router ../router-slim \ | ||
29 | amb | 1388 | ../filedumper ../filedumper-slim \ |
30 | is-fast-math | ||
31 | amb | 691 | |
32 | # Compilation targets | ||
33 | |||
34 | O=$(notdir $(wildcard *.osm)) | ||
35 | S=$(foreach f,$(O),$(addsuffix .sh,$(basename $f))) | ||
36 | |||
37 | ######## | ||
38 | |||
39 | all : | ||
40 | @true | ||
41 | |||
42 | ######## | ||
43 | |||
44 | amb | 698 | exe : |
45 | amb | 691 | cd .. && $(MAKE) |
46 | |||
47 | ######## | ||
48 | |||
49 | amb | 1388 | test : exe is-fast-math |
50 | amb | 691 | @status=true ;\ |
51 | amb | 1388 | echo ""; \ |
52 | ./is-fast-math message; \ | ||
53 | amb | 691 | for script in $(S); do \ |
54 | echo "" ;\ | ||
55 | amb | 975 | echo "Testing: $$script (non-slim, no pruning) ... " ;\ |
56 | amb | 691 | if ./$$script fat; then echo "... passed"; else echo "... FAILED"; status=false; fi ;\ |
57 | done ;\ | ||
58 | for script in $(S); do \ | ||
59 | echo "" ;\ | ||
60 | amb | 1059 | echo "Testing: $$script (slim, no pruning) ... " ;\ |
61 | amb | 691 | if ./$$script slim; then echo "... passed"; else echo "... FAILED"; status=false; fi ;\ |
62 | done ;\ | ||
63 | echo "" ;\ | ||
64 | if $$status; then echo "Success: all tests passed"; else echo "Warning: Some tests FAILED"; fi ;\ | ||
65 | $$status || exit 1 ;\ | ||
66 | echo "" ;\ | ||
67 | echo "Comparing: slim and non-slim results ... " ;\ | ||
68 | if diff -q -r slim fat; then echo "... matched"; else echo "... match FAILED"; status=false; fi ;\ | ||
69 | amb | 709 | echo "" ;\ |
70 | if $$status; then echo "Success: slim and non-slim results match"; else echo "Warning: slim and non-slim results are different - FAILED"; fi ;\ | ||
71 | amb | 975 | for script in $(S); do \ |
72 | echo "" ;\ | ||
73 | echo "Testing: $$script (non-slim, pruning) ... " ;\ | ||
74 | if ./$$script fat prune; then echo "... passed"; else echo "... FAILED"; status=false; fi ;\ | ||
75 | done ;\ | ||
76 | for script in $(S); do \ | ||
77 | echo "" ;\ | ||
78 | echo "Testing: $$script (slim, pruning) ... " ;\ | ||
79 | if ./$$script slim prune; then echo "... passed"; else echo "... FAILED"; status=false; fi ;\ | ||
80 | done ;\ | ||
81 | echo "" ;\ | ||
82 | if $$status; then echo "Success: all tests passed"; else echo "Warning: Some tests FAILED"; fi ;\ | ||
83 | $$status || exit 1 ;\ | ||
84 | echo "" ;\ | ||
85 | echo "Comparing: slim and non-slim results ... " ;\ | ||
86 | if diff -q -r slim-pruned fat-pruned; then echo "... matched"; else echo "... match FAILED"; status=false; fi ;\ | ||
87 | echo "" ;\ | ||
88 | if $$status; then echo "Success: slim and non-slim results match"; else echo "Warning: slim and non-slim results are different - FAILED"; fi ;\ | ||
89 | amb | 691 | $$status |
90 | |||
91 | ######## | ||
92 | |||
93 | amb | 1388 | is-fast-math : is-fast-math.o |
94 | $(LD) $< -o $@ $(LDFLAGS) | ||
95 | |||
96 | is-fast-math.o : is-fast-math.c | ||
97 | $(CC) -c $(CFLAGS) $< -o $@ | ||
98 | |||
99 | ######## | ||
100 | |||
101 | amb | 691 | clean: |
102 | amb | 975 | rm -rf fat |
103 | amb | 691 | rm -rf slim |
104 | amb | 975 | rm -rf fat-pruned |
105 | rm -rf slim-pruned | ||
106 | amb | 739 | rm -f *.log |
107 | amb | 1045 | rm -f *~ |
108 | amb | 1388 | rm -f *.o |
109 | amb | 739 | rm -f core |
110 | amb | 1045 | rm -f *.gcda *.gcno *.gcov gmon.out |
111 | amb | 691 | |
112 | ######## | ||
113 | |||
114 | distclean: clean | ||
115 | amb | 1388 | rm -f is-fast-math |
116 | amb | 913 | |
117 | ######## | ||
118 | |||
119 | amb | 1388 | .PHONY:: all exe test install clean distclean |