-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathtest.sh
executable file
·81 lines (66 loc) · 1.5 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
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
#/bin/bash
TEST_DIR="./test"
BUILD_DIR=$PWD
PROJECT=test
function exit_error()
{
error=$?
if [ $error -ne 0 ] ; then
echo Exit error $error
exit $error
fi
}
function clean()
{
$BUILD_DIR/build -c --config $PROJECT.config $PROJECT.build $FLAGS
exit_error
}
function test_no()
{
echo "Compiling test project with all flags NO"
$BUILD_DIR/build --config $PROJECT.config $PROJECT.build --configure --allno-config $FLAGS
exit_error
$BUILD_DIR/build --config $PROJECT.config $PROJECT.build -t random $FLAGS
exit_error
}
function test_yes()
{
echo "Compiling test project with all flags YES"
$BUILD_DIR/build --config $PROJECT.config $PROJECT.build --configure --allyes-config $FLAGS
exit_error
$BUILD_DIR/build --config $PROJECT.config $PROJECT.build -t random $FLAGS
exit_error
}
function test_random()
{
echo "Compiling test project with random flags"
$BUILD_DIR/build --config $PROJECT.config $PROJECT.build --random-config $FLAGS
exit_error
$BUILD_DIR/build --config $PROJECT.config $PROJECT.build $FLAGS
exit_error
}
function test_user()
{
echo "Compiling test project with user defined flags"
$BUILD_DIR/build --config $PROJECT.config $PROJECT.build --configure $FLAGS
exit_error
$BUILD_DIR/build --config $PROJECT.config $PROJECT.build -t random $FLAGS
exit_error
}
echo "Testing build..."
cd $TEST_DIR
echo " ** Test 1:"
test_no
clean
echo " ** Test 2:"
test_yes
clean
echo " ** Test: 3"
test_random
clean
if [ "$1" != "auto" ]; then
echo " ** Test 4:"
test_user
clean
fi
cd $BUILD_DIR