blob: 5416fa3beee7d34540dca2b81a9b2cc3f2032129 (
plain)
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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
|
if [ ! -d "build" ]; then
mkdir build
fi
COMPILE=gcc
COMPILEPP=g++
OBJ_POSTFIX=.o
EXE_POSTFIX=
case $(uname | tr '[:upper:]' '[:lower:]') in
*darwin*)
if command -v clang >/dev/null 2>&1; then
echo "C compiler found - Clang"
COMPILE=clang
COMPILEPP=clang
elif command -v gcc >/dev/null 2>&1; then
echo "C compiler found - GCC"
else
echo "C compiler not found"
exit 1
fi
;;
*msys*|*cygwin*|*mingw*|*nt*|*win*)
echo "C compiler found - MSVC"
COMPILE=cl.exe
COMPILEPP=cl.exe
OBJ_POSTFIX=.obj
EXE_POSTFIX=.exe
;;
*)
if command -v gcc >/dev/null 2>&1; then
echo "C compiler found - GCC"
elif command -v clang >/dev/null 2>&1; then
echo "C compiler found - Clang"
COMPILE=clang
COMPILEPP=clang
else
echo "C compiler not found"
exit 1
fi
;;
esac
echo ""
$COMPILE -c -o "build/kit${OBJ_POSTFIX}" "source/kit/_static.c"
if [ ! $? -eq 0 ]; then
exit 1
fi
$COMPILE -c -o "build/kit_test${OBJ_POSTFIX}" "source/kit_test/_static.c"
if [ ! $? -eq 0 ]; then
exit 1
fi
$COMPILE -o "build/kit_test_suite${EXE_POSTFIX}" \
"build/kit${OBJ_POSTFIX}" \
"build/kit_test${OBJ_POSTFIX}" \
"source/tests/_static.c"
if [ ! $? -eq 0 ]; then
exit 1
fi
$COMPILE -o "build/test_too_many_assertions${EXE_POSTFIX}" \
"build/kit${OBJ_POSTFIX}" \
"build/kit_test${OBJ_POSTFIX}" \
"source/tests/test_too_many_assertions.c"
if [ ! $? -eq 0 ]; then
exit 1
fi
$COMPILE -o "build/test_too_many_tests${EXE_POSTFIX}" \
"build/kit${OBJ_POSTFIX}" \
"build/kit_test${OBJ_POSTFIX}" \
"source/tests/test_too_many_tests.c"
if [ ! $? -eq 0 ]; then
exit 1
fi
$COMPILEPP -o "build/test_cpp${EXE_POSTFIX}" \
"build/kit${OBJ_POSTFIX}" \
"build/kit_test${OBJ_POSTFIX}" \
"source/tests/test_cpp.cpp"
if [ ! $? -eq 0 ]; then
exit 1
fi
$COMPILEPP -o "build/test_signals${EXE_POSTFIX}" \
"build/kit${OBJ_POSTFIX}" \
"build/kit_test${OBJ_POSTFIX}" \
"source/tests/test_signals.cpp"
if [ ! $? -eq 0 ]; then
exit 1
fi
echo "Run tests"
echo ""
STATUS=0
./build/kit_test_suite
if [ ! $? -eq 0 ]; then
STATUS=1
fi
./build/test_too_many_assertions --quiet
if [ $? -eq 0 ]; then
echo "too many assertions - OK"
else
echo "too many assertions - FAILED (code $?)"
STATUS=1
fi
./build/test_too_many_tests --quiet
if [ $? -eq 0 ]; then
echo "too many tests - OK"
else
echo "too many tests - FAILED (code $?)"
STATUS=1
fi
./build/test_cpp --quiet
if [ $? -eq 0 ]; then
echo "cpp - OK"
else
echo "cpp - FAILED (code $?)"
STATUS=1
fi
./build/test_signals --quiet
if [ $? -eq 0 ]; then
echo "signals - OK"
else
echo "signals - FAILED (code $?)"
STATUS=1
fi
exit $STATUS
|