-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathtest.sh
More file actions
executable file
·70 lines (55 loc) · 1.26 KB
/
test.sh
File metadata and controls
executable file
·70 lines (55 loc) · 1.26 KB
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
#! /bin/bash
SKIP_LIBCPP=$1
function run_docker()
{
file=$1
useLibcpp=$2
arg=''
if [[ ${useLibcpp} -eq 1 ]]; then
echo "With libc++"
arg="-use-libc++"
else
echo "With libstdc++"
fi
# --security-opt seccomp=unconfined is required for gdb to turn of randomization
docker run -h insights-testtest --net=none -v ${file}:/home/insights/insights.cpp --rm -i --security-opt seccomp=unconfined insights-testtest ${arg} -- -std=c++17
}
function run_test()
{
file=$1
run_docker ${file} 0
retNoLibcpp=$?
if [[ $SKIP_LIBCPP == 0 ]]; then
run_docker ${file} 1
retLibcpp=$?
[[ $retNoLibcpp == 0 ]] && [[ $retLibcpp == 0 ]]
else
[[ $retNoLibcpp == 0 ]]
fi
}
run_test `pwd`/byte.cpp
if [[ $? != 0 ]]; then
echo "Failed to compile byte.cpp"
exit 1
fi
run_test `pwd`/test.cpp
if [[ $? != 0 ]]; then
echo "Failed to compile test.cpp"
exit 1
fi
run_test `pwd`/limits.cpp
if [[ $? != 0 ]]; then
echo "Failed to compile limits.cpp"
exit 1
fi
run_test `pwd`/benchmark.cpp
if [[ $? != 0 ]]; then
echo "Failed to compile benchmark.cpp"
exit 1
fi
run_test `pwd`/boost.cpp
if [[ $? != 0 ]]; then
echo "Failed to compile boost.cpp"
exit 1
fi
exit 0