[gjs: 1/2] tests: Fail debugger tests if command failed
- From: Philip Chimento <pchimento src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gjs: 1/2] tests: Fail debugger tests if command failed
- Date: Thu, 10 Oct 2019 00:47:11 +0000 (UTC)
commit 1dba259b91ddab6cae4a0f32b7a0d7a4d02ea944
Author: Philip Chimento <philip endlessm com>
Date: Wed Oct 9 13:50:54 2019 -0700
tests: Fail debugger tests if command failed
This command fails, for example, if /usr/bin/diff is not installed. If
that's the case then the test should fail, rather than passing with an
error message which could be overlooked.
installed-tests/debugger-test.sh | 5 +++++
1 file changed, 5 insertions(+)
---
diff --git a/installed-tests/debugger-test.sh b/installed-tests/debugger-test.sh
index 5052d8b8..730caf4f 100755
--- a/installed-tests/debugger-test.sh
+++ b/installed-tests/debugger-test.sh
@@ -15,6 +15,11 @@ THE_DIFF=$("$gjs" -d "$JS_SCRIPT" < "$DEBUGGER_SCRIPT" | sed \
-e "s#$1#$(basename $1)#g" \
-e "s/0x[0-9a-f]\{4,16\}/0xADDR/g" \
| diff -u "$EXPECTED_OUTPUT" -)
+if test $? -ne 0; then
+ echo "not ok 1 - $1 # command failed"
+ exit 1
+fi
+
if test -n "$THE_DIFF"; then
echo "not ok 1 - $1"
echo "$THE_DIFF" | while read line; do echo "#$line"; done
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]