-
Notifications
You must be signed in to change notification settings - Fork 1
/
combinations.sh
executable file
·57 lines (54 loc) · 1.49 KB
/
combinations.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
#!/bin/bash
make_jobs=$(($(nproc) + 1))
feature_combinations=$(echo {0..1}{0..1}{0..1}{0..1}{0..1}{0..1})
for feature in $feature_combinations; do
arguments="-DCMAKE_BUILD_TYPE=\"RELEASE\" -DTRALLOC_MAN=0 "
if [ "${feature:0:1}" == "1" ]; then
arguments+="-DTRALLOC_DEBUG=1 "
else
arguments+="-DTRALLOC_DEBUG=0 "
fi
if [ "${feature:1:1}" == "1" ]; then
arguments+="-DTRALLOC_LENGTH=1 "
else
arguments+="-DTRALLOC_LENGTH=0 "
fi
if [ "${feature:2:1}" == "1" ]; then
arguments+="-DTRALLOC_DESTRUCTOR=1 "
else
arguments+="-DTRALLOC_DESTRUCTOR=0 "
fi
if [ "${feature:3:1}" == "1" ]; then
arguments+="-DTRALLOC_REFERENCE=1 "
else
arguments+="-DTRALLOC_REFERENCE=0 "
fi
if [ "${feature:4:1}" == "1" ]; then
arguments+="-DTRALLOC_POOL=1 "
else
arguments+="-DTRALLOC_POOL=0 "
fi
if [ "${feature:5:1}" == "1" ]; then
arguments+="-DTRALLOC_UTILS_BUFFER=1 "
else
arguments+="-DTRALLOC_UTILS_BUFFER=0 "
fi
arguments+="$@"
command="cmake .. $arguments && make clean && make -j $make_jobs"
echo $command
eval $command
if [ ! $? -eq 0 ]; then
echo "Failed arguments:"
echo " $arguments"
exit 1
fi
if [ -z "$NO_TESTS" ]; then
eval "make test"
if [ ! $? -eq 0 ]; then
echo "Failed arguments:"
echo " $arguments"
exit 1
fi
fi
done
echo "Success"