-
Notifications
You must be signed in to change notification settings - Fork 82
/
test.sh
executable file
·47 lines (31 loc) · 1.01 KB
/
test.sh
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
#!/bin/bash
set -eu
# clean before building
rm -rf *-build
# first build with default option
BUILD_EXTRAS=1 ./build.sh
# then build in various ways
for b in Debug Release;do
# not testable here: mac windows
for hid in libudev libusb pcapsimulate;do
echo
echo Building ${b} with hid: ${hid}
# fully clean previous compilation
rm -rf *-build
# build with current build-options
BUILD_EXTRAS=1 HIDAPI_DRIVER=${hid} ./build.sh -DCMAKE_BUILD_TYPE=${b}
# run unit-tests
unittest-build/unittest
done
done
# ensure that openambit2gpx.py works
echo
echo Testing openambit2gpx
rm -f "${TMP:-/tmp}"/testlog.gpx
python2.7 tools/openambit2gpx.py test-data/testlog.log -out "${TMP:-/tmp}"/testlog.gpx
diff --ignore-all-space test-data/testlog.gpx "${TMP:-/tmp}"/testlog.gpx
rm -f "${TMP:-/tmp}"/testlog.gpx
python3 tools/openambit2gpx.py test-data/testlog.log -out "${TMP:-/tmp}"/testlog.gpx
diff --ignore-all-space test-data/testlog.gpx "${TMP:-/tmp}"/testlog.gpx
echo
echo Done, all tests passed