-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild_and_run_tests.sh
47 lines (37 loc) · 1.03 KB
/
build_and_run_tests.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
#!/bin/bash
config=${1}
platform=${2}
toolset=${3}
extra=${4}
if [ "$config" = "" ]; then
config=debug
fi
if [ "$platform" = "" ]; then
platform=linux
fi
if [ "$toolset" = "" ]; then
toolset=clang
fi
pushd projects
make -f modernstringformatsolution_${platform}_${toolset}.make config=${config} ${extra}
exitcode=$?
popd
if [ ${exitcode} = 0 ]; then
if [ "$extra" != "clean" ]; then
# try yo handle both lower case and camel case files. This can change depending on
# whether projects were generated on windows or linux (todo: fix that)
# upper case the first letter of Release of Debug to match output paths
exe=./.temp/bin/modernstringformatproject_make_${platform}_${toolset}_${config}
if [ ! -f "$exe" ]; then
config="$(tr '[:lower:]' '[:upper:]' <<< ${config:0:1})${config:1}"
exe=./.temp/bin/modernstringformatproject_${platform}_${toolset}_${config}
fi
$exe
exit1=$?
if [ ${exit1} != 0 ]; then
exitcode=${exit1}
echo modernstringformat_ failed with ${exit1}
fi
fi
fi
exit ${exitcode}