Check out the latest version of Routino: svn co http://routino.org/svn/trunk routino
Contents of /trunk/src/test/cycle-drive.sh
Parent Directory
|
Revision Log
Revision 1556 -
(show annotations)
(download)
(as text)
Mon Apr 28 18:09:25 2014 UTC (10 years, 11 months ago) by amb
File MIME type: text/x-sh
File size: 2442 byte(s)
Mon Apr 28 18:09:25 2014 UTC (10 years, 11 months ago) by amb
File MIME type: text/x-sh
File size: 2442 byte(s)
Add a test case for the ability to cycle both ways on highways that allow it. Tests the roundabout exit naming as well as shortest route.
1 | #!/bin/sh |
2 | |
3 | # Exit on error |
4 | |
5 | set -e |
6 | |
7 | # Test name |
8 | |
9 | name=`basename $0 .sh` |
10 | |
11 | # Slim or non-slim |
12 | |
13 | if [ "$1" = "slim" ]; then |
14 | slim="-slim" |
15 | dir="slim" |
16 | else |
17 | slim="" |
18 | dir="fat" |
19 | fi |
20 | |
21 | # Pruned or non-pruned |
22 | |
23 | if [ "$2" = "prune" ]; then |
24 | prune="" |
25 | pruned="-pruned" |
26 | else |
27 | prune="--prune-none" |
28 | pruned="" |
29 | fi |
30 | |
31 | # Create the output directory |
32 | |
33 | dir="$dir$pruned" |
34 | |
35 | [ -d $dir ] || mkdir $dir |
36 | |
37 | # Run the programs under a run-time debugger |
38 | |
39 | debugger=valgrind |
40 | debugger= |
41 | |
42 | # Name related options |
43 | |
44 | osm=$name.osm |
45 | log=$name$slim$pruned.log |
46 | |
47 | option_prefix="--prefix=$name" |
48 | option_dir="--dir=$dir" |
49 | |
50 | # Generic program options |
51 | |
52 | option_planetsplitter="--loggable --tagging=../../xml/routino-tagging.xml --errorlog $prune" |
53 | option_filedumper="--dump-osm" |
54 | option_router="--loggable --profiles=../../xml/routino-profiles.xml --translations=copyright.xml" |
55 | |
56 | # Run planetsplitter |
57 | |
58 | echo "Running planetsplitter" |
59 | |
60 | echo ../planetsplitter$slim $option_dir $option_prefix $option_planetsplitter $osm > $log |
61 | $debugger ../planetsplitter$slim $option_dir $option_prefix $option_planetsplitter $osm >> $log |
62 | |
63 | # Run filedumper |
64 | |
65 | echo "Running filedumper" |
66 | |
67 | echo ../filedumper$slim $option_dir $option_prefix $option_filedumper >> $log |
68 | $debugger ../filedumper$slim $option_dir $option_prefix $option_filedumper > $dir/$osm |
69 | |
70 | # Waypoints |
71 | |
72 | waypoints=`perl waypoints.pl $osm list` |
73 | |
74 | waypoint_start=`perl waypoints.pl $osm WPstart 1` |
75 | waypoint_finish=`perl waypoints.pl $osm WPfinish 2` |
76 | |
77 | # Run the router for each transport type |
78 | |
79 | transports="motorcar bicycle" |
80 | |
81 | for transport in $transports; do |
82 | |
83 | case $transport in |
84 | motorcar) waypoint=WP01 ;; |
85 | *) waypoint=WP02 ;; |
86 | esac |
87 | |
88 | echo "Running router : $waypoint" |
89 | |
90 | [ -d $dir/$name-$waypoint ] || mkdir $dir/$name-$waypoint |
91 | |
92 | echo ../router$slim $option_dir $option_prefix $option_osm $option_router --transport=$transport $waypoint_start $waypoint_finish >> $log |
93 | $debugger ../router$slim $option_dir $option_prefix $option_osm $option_router --transport=$transport $waypoint_start $waypoint_finish >> $log |
94 | |
95 | mv shortest* $dir/$name-$waypoint |
96 | |
97 | echo diff -u expected/$name-$waypoint.txt $dir/$name-$waypoint/shortest-all.txt >> $log |
98 | |
99 | if ./is-fast-math; then |
100 | diff -U 0 expected/$name-$waypoint.txt $dir/$name-$waypoint/shortest-all.txt | 2>&1 egrep '^[-+] ' || true |
101 | else |
102 | diff -u expected/$name-$waypoint.txt $dir/$name-$waypoint/shortest-all.txt >> $log |
103 | fi |
104 | |
105 | done |
Properties
Name | Value |
---|---|
svn:executable | * |