-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest_runner
executable file
·77 lines (66 loc) · 1.41 KB
/
test_runner
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
#!/bin/sh
tests="test001 test002 test003 test004 test005 test006 test007 test008 \
test009 test010 test011 test012 test013 test014 test015 test016 test017 test018 \
test019 test020 test021 test022 test023 test024 test025"
command=""
case "$1" in
"list")
for test in $tests
do
echo $test
done
exit
;;
"describe")
command=describe
;;
"run")
command=run
;;
*)
printf 'Usage:\n'
printf " $(basename $0) <command>\n"
printf '\n'
echo \<command\> can be:
printf ' list - list tests\n'
exit 1
;;
esac
if ! [ -v MESON_BUILD_ROOT ]
then MESON_BUILD_ROOT=$PWD/builddir
echo No MESON_BUILD_ROOT environment variable set. Defaulting to: $MESON_BUILD_ROOT
fi
if ! [ -v MESON_SOURCE_ROOT ]
then MESON_SOURCE_ROOT=$PWD
echo No MESON_SOURCE_ROOT environment variable set. Defaulting to: $MESON_SOURCE_ROOT
fi
if [ $command == "describe" ]
then echo -n $($MESON_SOURCE_ROOT/tests/$2 describe)
exit
fi
test_subject=$MESON_BUILD_ROOT/clf-to-sqlite
function run_test {
echo -n "$1......"
$MESON_SOURCE_ROOT/tests/$1 describe
$MESON_SOURCE_ROOT/tests/$1 $test_subject
if [ $? != 0 ]; then
echo ......FAIL
exit 1
else
echo ......OK
fi
}
if [ ! -d $MESON_BUILD_ROOT/tests/actual_results ]; then
mkdir $MESON_BUILD_ROOT/tests/actual_results --parents
fi
rm $MESON_BUILD_ROOT/test/actual_results/* -f
if [ ! -z "$2" ]
then tests=$2
fi
cwd=$PWD
cd $MESON_BUILD_ROOT/tests
for test in $tests
do
run_test $test
done
cd $cwd