[SCM] Installer for game data files branch, master, updated. efd46d96e303f4a3f010a93ae2ee1d6c68315639

Jon Dowland jmtd at debian.org
Tue Sep 11 21:08:31 UTC 2012


The following commit has been merged in the master branch:
commit 02d162a13d499a026f6828b6f640292e824cac2e
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