File: check_vik2vik.sh

package info (click to toggle)
viking 1.11-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 18,468 kB
  • sloc: ansic: 81,706; xml: 2,893; sh: 2,501; makefile: 874; python: 589; perl: 384; cpp: 259
file content (35 lines) | stat: -rwxr-xr-x 896 bytes parent folder | download | duplicates (2)
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
#!/bin/sh

# Enable running in test directory or via make distcheck when $srcdir is defined
if [ -z "$srcdir" ]; then
  srcdir=.
fi

outfile=./testout-$$.vik

# ATM Tests either full, no libgps or no geoclue
# Not going to try to cover all potential options, such as
#  no gps && no geoclue at the same time

if [ -z "$REALTIME_GPS_TRACKING" ]; then
    testvik=$srcdir/Simple_no-realtime-gps-tracking.vik
elif [ -z "$GEOCLUE_ENABLED" ]; then
    testvik=$srcdir/Simple_no-geoclue.vik
else
    testvik=$srcdir/Simple.vik
fi

result=$(./vik2vik < $testvik $outfile)
if [ $? != 0 ]; then
  echo "vik2vik command failure"
  exit 1
fi

# Avoid maps directory as a blank input value may get saved with a user path specific default
sed -i '/^directory=/d' $outfile
grep -v "^directory=" $testvik | diff $outfile -
if [ $? != 0 ]; then
  echo "vik2vik produced different result"
  exit 1
fi
rm $outfile