-
Notifications
You must be signed in to change notification settings - Fork 167
/
clone_and_test.sh
executable file
·65 lines (55 loc) · 2.25 KB
/
clone_and_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
#!/bin/bash -ex
# get travis env
echo "TRAVIS_EVENT_TYPE: ${TRAVIS_EVENT_TYPE}"
echo "TRAVIS_BRANCH: ${TRAVIS_BRANCH}"
echo "TRAVIS_REPO_SLUG: ${TRAVIS_REPO_SLUG}"
echo "TRAVIS_PULL_REQUEST_SLUG: ${TRAVIS_PULL_REQUEST_SLUG}"
echo "TRAVIS_PULL_REQUEST_BRANCH: ${TRAVIS_PULL_REQUEST_BRANCH}"
# set default variable if not in env
if [ -z ${TRAVIS_EVENT_TYPE} ]; then
TRAVIS_EVENT_TYPE="push";
echo "TRAVIS_EVENT_TYPE set to push";
fi
if [ -z ${TRAVIS_BRANCH} ]; then
TRAVIS_BRANCH="main";
echo "TRAVIS_BRANCH set to main";
fi
# check if this is a pull request or a push
if [ ${TRAVIS_EVENT_TYPE} == "pull_request" ]; then
git clone https://github.com/${TRAVIS_PULL_REQUEST_SLUG} souper-test;
cd souper-test;
git checkout ${TRAVIS_PULL_REQUEST_BRANCH};
ln -s /usr/src/souper/third_party;
else
# it's a push
git clone https://github.com/${TRAVIS_REPO_SLUG} souper-test;
cd souper-test;
git checkout ${TRAVIS_BRANCH};
ln -s /usr/src/souper/third_party;
fi
Z3=/usr/bin/z3
SRCDIR="$PWD"
# invoke run_lit directly since ninja buffers output causing Travis to
# give up after 10 minutes
mkdir build-release
cd build-release
PATH=/usr/src/souper/third_party/llvm/Release/bin:$PATH cmake -G Ninja -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_FLAGS='-Werror' -DTEST_SYNTHESIS=ON -DTEST_LONG_DURATION_SYNTHESIS=OFF -DCMAKE_BUILD_TYPE=Release ..
ninja
LIT_ARGS="-v -vv" ./run_lit
#LIT_ARGS="-v -vv --vg --vg-arg=--trace-children-skip=$Z3 --vg-arg=--suppressions=$SRCDIR/valgrind.supp" ./run_lit
cd ..
# TODO: turn on ASan as well, which requires LLVM to be built with it
# in order to get our pass to work
#mkdir build-release-sanitize
#cd build-release-sanitize
#PATH=/usr/src/souper/third_party/llvm/Release/bin:$PATH cmake -G Ninja -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_FLAGS='-fsanitize=undefined -fno-sanitize-recover=all -Werror' -DTEST_SYNTHESIS=ON -DTEST_LONG_DURATION_SYNTHESIS=OFF -DCMAKE_BUILD_TYPE=Release ..
#ninja
#LIT_ARGS="-v -vv" ./run_lit
#cd ..
#mkdir build-debug
#cd build-debug
#cmake -G Ninja -DTEST_SYNTHESIS=ON -DCMAKE_BUILD_TYPE=Debug ..
#ninja
#LIT_ARGS="-v -vv" ninja check
#LIT_ARGS="-v -vv --vg --vg-arg=--trace-children-skip=$Z3 --vg-arg=--suppressions=$SRCDIR/valgrind.supp" ninja check
#cd ..