-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathtest.sh
executable file
·45 lines (37 loc) · 946 Bytes
/
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
#!/usr/bin/env bash
builddir="$1"
test="$2"
cwddir=$(pwd)
$builddir/testinternals
beak="$builddir/beak"
testscripts=$(ls tests/test*.sh)
testoutput=$(pwd)/test_output
rm -rf $testoutput
mkdir -p $testoutput
if [ "$BASH_VERSION" = "" ]
then
echo "You have to run this script with bash!"
exit 1
fi
if [[ $BASH_VERSION =~ ^3\. ]]
then
echo "You have to run an up to date bash! This is version $BASH_VERSION but you should use 5 or later."
exit 1
fi
./tests/test_basics.sh "$cwddir" "$builddir/beak" "$test"
if [ "$?" != "0" ]; then echo "ERROR: basics" ; exit 1; fi
for i in $testscripts
do
thetest=$(basename $i)
thetest=${thetest%.sh}
testdir=$testoutput/$thetest
if [ "$thetest" != "test_basics" ]
then
if [ "$test" = "" ] || [[ "$testtest" =~ "$test" ]]
then
echo $thetest
$i $beak $testdir
if [ $? == "0" ]; then echo OK; fi
fi
fi
done