From 42bc7a3c50e04a44765809a33531539350b37a77 Mon Sep 17 00:00:00 2001 From: Petri Lehtinen Date: Thu, 26 Apr 2012 08:58:31 +0300 Subject: [PATCH] Check for missing args and envvars in run-tests.sh Fixes #71. --- test/scripts/run-tests.sh | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/test/scripts/run-tests.sh b/test/scripts/run-tests.sh index c3be566..39ebfc4 100644 --- a/test/scripts/run-tests.sh +++ b/test/scripts/run-tests.sh @@ -3,6 +3,18 @@ # Jansson is free software; you can redistribute it and/or modify # it under the terms of the MIT license. See LICENSE for details. +die() { + echo "$1" >&2 + exit 1 +} + +[ -n "$1" ] || die "Usage: $0 suite-name" +[ -n "$bindir" ] || die "Set bindir" +[ -n "$logdir" ] || die "Set logdir" +[ -n "$scriptdir" ] || die "Set scriptdir" +[ -n "$suites_srcdir" ] || die "Set suites_srcdir" +[ -n "$suites_builddir" ] || die "Set suites_builddir" + json_process=$bindir/json_process suite_name=$1 @@ -10,7 +22,6 @@ suite_srcdir=$suites_srcdir/$suite_name suite_builddir=$suites_builddir/$suite_name suite_log=$logdir/$suite_name - [ -z "$VERBOSE" ] && VERBOSE=0 [ -z "$STOP" ] && STOP=0