[SCM] Git repository for devscripts branch, master, updated. v2.12.4-43-g227b8b8

Benjamin Drung bdrung at debian.org
Thu Oct 25 20:17:07 UTC 2012


The following commit has been merged in the master branch:
commit 37145771022138d4e66decb426e4de4310a9c7e4
Author: Benjamin Drung <bdrung at debian.org>
Date:   Thu Oct 25 21:59:29 2012 +0200

    Add test case from Raphael Geissert for previous commit.

diff --git a/test/bashisms/exit-code.sh b/test/bashisms/exit-code.sh
new file mode 100644
index 0000000..48b9fcd
--- /dev/null
+++ b/test/bashisms/exit-code.sh
@@ -0,0 +1,7 @@
+#!/bin/sh
+
+# http://bugs.debian.org/687450
+exit -- 2 # BASHISM
+exit 255
+exit 256 # BASHISM
+exit -1 # BASHISM
diff --git a/test/bashisms/exit-code.sh.out b/test/bashisms/exit-code.sh.out
new file mode 100644
index 0000000..01cfe72
--- /dev/null
+++ b/test/bashisms/exit-code.sh.out
@@ -0,0 +1,6 @@
+possible bashism in bashisms/exit-code.sh line 4 ('exit --' should be 'exit'):
+exit -- 2 # BASHISM
+possible bashism in bashisms/exit-code.sh line 6 (exit status code greater than 255):
+exit 256 # BASHISM
+possible bashism in bashisms/exit-code.sh line 7 (exit with negative status code):
+exit -1 # BASHISM
diff --git a/test/test_checkbashisms b/test/test_checkbashisms
index b94abd9..9eedcef 100755
--- a/test/test_checkbashisms
+++ b/test/test_checkbashisms
@@ -73,6 +73,10 @@ test_dynamic_length() {
     found "bashisms/dynamic-length.sh" "$(cat bashisms/dynamic-length.sh.out)"
 }
 
+test_exit_code() {
+    found "bashisms/exit-code.sh" "$(cat bashisms/exit-code.sh.out)"
+}
+
 test_fail2ban() {
     clean "bashisms/fail2ban.sh"
 }

-- 
Git repository for devscripts



More information about the devscripts-devel mailing list