From e9bea64ae432ec3cdd6d2ccbd691190a35256d97 Mon Sep 17 00:00:00 2001 From: Michael Jeanson Date: Thu, 1 Dec 2016 11:56:08 -0500 Subject: [PATCH] Tests: Add verbose support to test script Add support for the standard "V=1" to make the test runner script verbose. Signed-off-by: Michael Jeanson Signed-off-by: Mathieu Desnoyers --- tests/benchmark/run.sh | 13 +++++++++++-- tests/regression/run.sh | 13 +++++++++++-- tests/unit/run.sh | 13 +++++++++++-- 3 files changed, 33 insertions(+), 6 deletions(-) diff --git a/tests/benchmark/run.sh b/tests/benchmark/run.sh index d99a493..1ec7e5e 100755 --- a/tests/benchmark/run.sh +++ b/tests/benchmark/run.sh @@ -1,6 +1,7 @@ #!/bin/bash # # Copyright (C) 2013 - Christian Babeux +# 2016 - Michael Jeanson # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License @@ -18,8 +19,16 @@ # INPUT=$1 +ARGS=() shift 1 -[ -z "${INPUT}" ] && echo "Error: No testlist. Please specify a testlist to run." && exit 1 +if [ -z "${INPUT}" ]; then + echo "Error: No testlist. Please specify a testlist to run." + exit 1 +fi -prove ${*} --merge --exec '' - < ${INPUT} +if [ "x$V" == "x1" ]; then + ARGS+=('-v') +fi + +prove "${@}" "${ARGS[@]}" --merge --exec '' - < "${INPUT}" diff --git a/tests/regression/run.sh b/tests/regression/run.sh index d99a493..1ec7e5e 100755 --- a/tests/regression/run.sh +++ b/tests/regression/run.sh @@ -1,6 +1,7 @@ #!/bin/bash # # Copyright (C) 2013 - Christian Babeux +# 2016 - Michael Jeanson # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License @@ -18,8 +19,16 @@ # INPUT=$1 +ARGS=() shift 1 -[ -z "${INPUT}" ] && echo "Error: No testlist. Please specify a testlist to run." && exit 1 +if [ -z "${INPUT}" ]; then + echo "Error: No testlist. Please specify a testlist to run." + exit 1 +fi -prove ${*} --merge --exec '' - < ${INPUT} +if [ "x$V" == "x1" ]; then + ARGS+=('-v') +fi + +prove "${@}" "${ARGS[@]}" --merge --exec '' - < "${INPUT}" diff --git a/tests/unit/run.sh b/tests/unit/run.sh index d99a493..1ec7e5e 100755 --- a/tests/unit/run.sh +++ b/tests/unit/run.sh @@ -1,6 +1,7 @@ #!/bin/bash # # Copyright (C) 2013 - Christian Babeux +# 2016 - Michael Jeanson # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License @@ -18,8 +19,16 @@ # INPUT=$1 +ARGS=() shift 1 -[ -z "${INPUT}" ] && echo "Error: No testlist. Please specify a testlist to run." && exit 1 +if [ -z "${INPUT}" ]; then + echo "Error: No testlist. Please specify a testlist to run." + exit 1 +fi -prove ${*} --merge --exec '' - < ${INPUT} +if [ "x$V" == "x1" ]; then + ARGS+=('-v') +fi + +prove "${@}" "${ARGS[@]}" --merge --exec '' - < "${INPUT}" -- 2.34.1