Skip to content

Commit

Permalink
ci: wrap in functions
Browse files Browse the repository at this point in the history
Signed-off-by: Norbert Manthey <[email protected]>
  • Loading branch information
conp-solutions committed Apr 8, 2021
1 parent 6d90aea commit a27f611
Showing 1 changed file with 19 additions and 3 deletions.
22 changes: 19 additions & 3 deletions tools/ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ CHECKERDIR=$(readlink -e tools/checker)

STATUS=0

if [ $TESTFUZZ -eq 1 ]; then
test_fuzzing ()
{
# Enter checker repository
pushd tools/checker

Expand All @@ -42,9 +43,14 @@ if [ $TESTFUZZ -eq 1 ]; then
./fuzz-check-configurations.sh || STATUS=$?

popd
}

if [ $TESTFUZZ -eq 1 ]; then
test_fuzzing
fi

if [ $TESTDIVERSIFY -eq 1 ]; then
test_diversify ()
{
# Enter checker repository
pushd tools/checker

Expand All @@ -56,6 +62,10 @@ if [ $TESTDIVERSIFY -eq 1 ]; then
./fuzz-check-configurations.sh || STATUS=$?

popd
}

if [ $TESTDIVERSIFY -eq 1 ]; then
test_diversify
fi

# locate release library
Expand All @@ -69,7 +79,9 @@ STATIC_LIB=$(readlink -e build/release/lib/libmergesat.a)
MERGEZIP=$(ls MergeSAT*.zip | sort -V | tail -n 1)
MERGEZIP=$(readlink -e $MERGEZIP)

if [ $TESTSTAREXEC -eq 1 ]; then
test_starexec ()
{

[ $CLEANUP -eq 0 ] || trap 'rm -rf $TMPD' EXIT
TMPD=$(mktemp -d)
cp "$MERGEZIP" "$TMPD"
Expand All @@ -91,6 +103,10 @@ if [ $TESTSTAREXEC -eq 1 ]; then
done
# finish starexec fuzzing
popd
}

if [ $TESTSTAREXEC -eq 1 ]; then
test_starexec
fi

test_openwbo() {
Expand Down

0 comments on commit a27f611

Please sign in to comment.