File: run-one-test.sh

package info (click to toggle)
routino 3.4.3-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 9,196 kB
  • sloc: ansic: 22,554; javascript: 7,897; xml: 5,980; perl: 2,597; cs: 921; makefile: 826; sh: 503; cpp: 382; python: 376
file content (100 lines) | stat: -rwxr-xr-x 1,658 bytes parent folder | download | duplicates (5)
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
#!/bin/sh

# Main tests directory

testdir=../../src/test

# Exit on error

set -e

# Test name

name=`basename $1 .sh`

# Libroutino location

LD_LIBRARY_PATH=$testdir/..:$LD_LIBRARY_PATH
export LD_LIBRARY_PATH

# Python build location

PYTHONPATH=`echo ../build/lib.*`
export PYTHONPATH

# Create the output directory

dir=results

[ -d $dir ] || mkdir $dir

# Name related options

osm=$testdir/$name.osm
log=$name.log

option_prefix="--prefix=$name"
option_dir="--dir=$testdir/fat"

# Generic program options

option_router="--profile=motorcar --profiles=../../xml/routino-profiles.xml --translations=$testdir/copyright.xml"


# Run waypoints program

run_waypoints()
{
    perl $testdir/waypoints.pl $@
}


# Run planetsplitter

run_planetsplitter()
{
    echo "Skipping planetsplitter"
}


# Run filedumper

run_filedumper()
{
    echo "Skipping filedumper"
}


# Run the router

run_router()
{
    waypoint=$1

    shift

    [ -d $dir/$name-$waypoint ] || mkdir $dir/$name-$waypoint

    echo ../router.py $option_dir $option_prefix $option_osm $option_router $@ >> $log
         ../router.py $option_dir $option_prefix $option_osm $option_router $@ >> $log

    mv shortest* $dir/$name-$waypoint

    echo diff -u $testdir/expected/$name-$waypoint.txt $dir/$name-$waypoint/shortest-all.txt >> $log

    if $testdir/is-fast-math; then
        diff -U 0 $testdir/expected/$name-$waypoint.txt $dir/$name-$waypoint/shortest-all.txt | 2>&1 egrep '^[-+] ' || true
    else
        diff -u $testdir/expected/$name-$waypoint.txt $dir/$name-$waypoint/shortest-all.txt >> $log
    fi
}


# Run the specific test script

. $testdir/$name.sh


# Finish

exit 0