diff options
Diffstat (limited to 'tests/build/run-tests.sh')
-rwxr-xr-x | tests/build/run-tests.sh | 34 |
1 files changed, 19 insertions, 15 deletions
diff --git a/tests/build/run-tests.sh b/tests/build/run-tests.sh index f78cc901..916df2e2 100755 --- a/tests/build/run-tests.sh +++ b/tests/build/run-tests.sh @@ -1,32 +1,36 @@ #!/bin/bash -log_file="`pwd`/tests.log" +log_file="$(pwd)/tests.log" dir=../.. argument=( --without-cli --with-cli=linenoise --with-cli=editline --enable-debug --with-mini-gmp --enable-man-doc --with-xtables --with-json) ok=0 failed=0 -[ -f $log_file ] && rm -rf $log_file +[ -f "$log_file" ] && rm -rf "$log_file" tmpdir=$(mktemp -d) -if [ ! -w $tmpdir ] ; then +if [ ! -w "$tmpdir" ] ; then echo "Failed to create tmp file" >&2 exit 0 fi -git clone $dir $tmpdir >/dev/null 2>>$log_file -cd $tmpdir +git clone "$dir" "$tmpdir" &>>"$log_file" +cd "$tmpdir" || exit -autoreconf -fi >/dev/null 2>>$log_file -./configure >/dev/null 2>>$log_file +if ! autoreconf -fi &>>"$log_file" ; then + echo "Something went wrong. Check the log '${log_file}' for details." + exit 1 +fi -echo "Testing build with distcheck" -make distcheck >/dev/null 2>>$log_file -rt=$? +if ! ./configure &>>"$log_file" ; then + echo "Something went wrong. Check the log '${log_file}' for details." + exit 1 +fi -if [ $rt != 0 ] ; then - echo "Something went wrong. Check the log for details." +echo "Testing build with distcheck" +if ! make distcheck &>>"$log_file" ; then + echo "Something went wrong. Check the log '${log_file}' for details." exit 1 fi @@ -35,8 +39,8 @@ echo "Build works. Now, testing compile options" for var in "${argument[@]}" ; do echo "[EXECUTING] Testing compile option $var" - ./configure $var >/dev/null 2>>$log_file - make -j 8 >/dev/null 2>>$log_file + ./configure "$var" &>>"$log_file" + make -j 8 &>>"$log_file" rt=$? echo -en "\033[1A\033[K" # clean the [EXECUTING] foobar line @@ -49,7 +53,7 @@ for var in "${argument[@]}" ; do fi done -rm -rf $tmpdir +rm -rf "$tmpdir" echo "results: [OK] $ok [FAILED] $failed [TOTAL] $((ok+failed))" [ "$failed" -eq 0 ] |