[SCM] Installer for game data files branch, testsuite, updated. 521cbfd9ee9133726037dd0213d70a46a2552c63

Jon Dowland jmtd at debian.org
Thu Dec 17 16:48:35 UTC 2009


The following commit has been merged in the testsuite branch:
commit 745fc58cf323b4d766d1e1e6fc2aa8b60d0e51d8
Author: Jon Dowland <jmtd at debian.org>
Date:   Thu Dec 17 16:20:12 2009 +0000

    add unit test for die

diff --git a/tests/lib/die b/tests/lib/die
new file mode 100755
index 0000000..e3f4fe4
--- /dev/null
+++ b/tests/lib/die
@@ -0,0 +1,14 @@
+#!/bin/sh
+set -u
+set -e 
+
+[ $# -eq 2 ] || {
+    echo "usage: $0 string retcode" >&2
+    exit 1
+}
+string="$1"
+retcode="$2"
+
+. ./lib/game-data-packager-shared
+
+die "$string" "$retcode"
diff --git a/tests/runtests b/tests/runtests
index 96bff66..ef2c6d3 100755
--- a/tests/runtests
+++ b/tests/runtests
@@ -24,5 +24,13 @@ test_md5sum_no() {
   ./tests/lib/verify_md5sum "tests/testfile" "incorrect"
   assertNotEquals $? 0
 } 
+test_die() {
+  # XXX: capture stderr and ensure it matches diestring
+  ./tests/lib/die "diestring" 6
+  assertEquals $? 6
+  ./tests/lib/die "diestring" 42
+  assertEquals $? 42
+}
+
 
 . ./tests/shunit2/shunit2

-- 
Installer for game data files



More information about the Pkg-games-commits mailing list