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

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


The following commit has been merged in the master branch:
commit 13a920ecd5e23034719bcf102475d3d4713cbdd3
Author: Jon Dowland <jmtd at debian.org>
Date:   Tue Dec 15 16:08:57 2009 +0000

    initial ghetto test harness

diff --git a/tests/lib/verify_md5sum b/tests/lib/verify_md5sum
new file mode 100755
index 0000000..cfc33f6
--- /dev/null
+++ b/tests/lib/verify_md5sum
@@ -0,0 +1,15 @@
+#!/bin/sh
+set -u
+set -e
+
+[ $# -eq 2 ] || {
+    echo "usage: $0 testfile md5sum" >&2
+    exit 1
+}
+file="$1"
+sum="$2"
+
+. ./lib/game-data-packager-shared
+
+verify_md5sum "$file" "$sum" >/dev/null 2>&1
+exit 0
diff --git a/tests/verify_md5sum b/tests/verify_md5sum
new file mode 100755
index 0000000..90e573b
--- /dev/null
+++ b/tests/verify_md5sum
@@ -0,0 +1,23 @@
+#!/bin/sh
+set -u
+set -e
+
+correct="6f5902ac237024bdd0c176cb93063dc4"
+incorrect="wrong"
+
+workdir=$(mktemp -td game-data-packager.tests.XXXXXX)
+echo hello world > "$workdir/testfile"
+
+if ./tests/lib/verify_md5sum "$workdir/testfile" "$correct"; then
+    echo pass
+else
+    echo fail
+fi
+if ! ./tests/lib/verify_md5sum "$workdir/testfile" "$incorrect"; then
+    echo pass
+else
+    echo fail
+fi
+
+rm "$workdir/testfile"
+rmdir "$workdir"

-- 
Installer for game data files



More information about the Pkg-games-commits mailing list