1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122
|
#!/bin/sh
# Exit on error
set -e
# Test name
name=`basename $0 .sh`
# Slim or non-slim
if [ "$1" = "slim" ]; then
slim="-slim"
dir="slim"
else
slim=""
dir="fat"
fi
# Libroutino or not libroutino
LD_LIBRARY_PATH=$PWD/..:$LD_LIBRARY_PATH
export LD_LIBRARY_PATH
if [ "$2" = "lib" ]; then
lib="+lib"
else
lib=""
fi
# Pruned or non-pruned
if [ "$2" = "prune" ]; then
prune=""
pruned="-pruned"
else
prune="--prune-none"
pruned=""
fi
# Create the output directory
dir=$dir$lib$pruned
[ -d $dir ] || mkdir $dir
# Run the programs under a run-time debugger
debugger=valgrind
debugger=
# Name related options
osm=$name.osm
log=$name$lib$slim$pruned.log
option_prefix="--prefix=$name"
option_dir="--dir=$dir"
# Generic program options
option_planetsplitter="--loggable --tagging=../../xml/routino-tagging.xml --errorlog $prune"
option_filedumper="--dump-osm"
option_router="--profiles=../../xml/routino-profiles.xml --translations=copyright.xml"
if [ ! "$2" = "lib" ]; then
option_router="$option_router --loggable"
fi
# Run planetsplitter
echo "Running planetsplitter"
echo ../planetsplitter$slim $option_dir $option_prefix $option_planetsplitter $osm > $log
$debugger ../planetsplitter$slim $option_dir $option_prefix $option_planetsplitter $osm >> $log
# Run filedumper
echo "Running filedumper"
echo ../filedumper$slim $option_dir $option_prefix $option_filedumper >> $log
$debugger ../filedumper$slim $option_dir $option_prefix $option_filedumper > $dir/$osm
# Waypoints
waypoints=`perl waypoints.pl $osm list`
waypoint_start=`perl waypoints.pl $osm WPstart 1`
waypoint_finish=`perl waypoints.pl $osm WPfinish 2`
# Run the router for each profile type
profiles="motorcar bicycle"
for profile in $profiles; do
case $profile in
motorcar) waypoint=WP01 ;;
*) waypoint=WP02 ;;
esac
echo "Running router : $waypoint"
[ -d $dir/$name-$waypoint ] || mkdir $dir/$name-$waypoint
echo ../routino-router$lib$slim $option_dir $option_prefix $option_osm $option_router --profile=$profile $waypoint_start $waypoint_finish >> $log
$debugger ../routino-router$lib$slim $option_dir $option_prefix $option_osm $option_router --profile=$profile $waypoint_start $waypoint_finish >> $log
mv shortest* $dir/$name-$waypoint
echo diff -u expected/$name-$waypoint.txt $dir/$name-$waypoint/shortest-all.txt >> $log
if ./is-fast-math; then
diff -U 0 expected/$name-$waypoint.txt $dir/$name-$waypoint/shortest-all.txt | 2>&1 egrep '^[-+] ' || true
else
diff -u expected/$name-$waypoint.txt $dir/$name-$waypoint/shortest-all.txt >> $log
fi
done
|