From b854736c8cadce8fcd13af02f3e3028423b125b1 Mon Sep 17 00:00:00 2001 From: fennecdjay Date: Sun, 7 Jul 2019 22:05:03 +0200 Subject: [PATCH] :white_check_mark: Yet more tests --- tests/sh/common.sh | 6 ++++-- tests/sh/opt.sh | 12 ++++++++++-- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/tests/sh/common.sh b/tests/sh/common.sh index e6b84272..74cef102 100644 --- a/tests/sh/common.sh +++ b/tests/sh/common.sh @@ -11,8 +11,10 @@ run() { good="All heap blocks were freed -- no leaks are possible" n=$(printf "% 4i" "$1") eval valgrind ./gwion "$OPT" "$UDP" -d "$DRIVER" "$3" &> "$4" - ok=0 - grep "$good" "$4" > /dev/null && ok=1 + if [ -f "$4" ] + then grep "$good" "$4" > /dev/null && ok=1 + else ok=1 + fi if [ $ok ] then echo "ok $n $2" else echo "not ok $n $2" diff --git a/tests/sh/opt.sh b/tests/sh/opt.sh index 478a8ecf..eca7fa7c 100644 --- a/tests/sh/opt.sh +++ b/tests/sh/opt.sh @@ -1,5 +1,5 @@ #!/bin/bash -# [test] #11 +# [test] #12 n=0 [ "$1" ] && n="$1" [ "$n" -eq 0 ] && n=1 @@ -53,4 +53,12 @@ run "$n" "plugin directory" "-p non_existant_dir" "file" # config n=$((n+1)) -run "$n" "config" "-k" "file" +cat << EOF >> tmp_gwionrc +-p. +-l0 +EOF +run "$n" "config" "-c tmp_gwionrc" "file" + +# loop +n=$((n+1)) +run "$n" "loop" "-l0" "file" -- 2.43.0