[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 f20e9743ccfd6200f0c5491a82887f1cbeda4720
Author: Jon Dowland <jmtd at debian.org>
Date:   Thu Dec 17 12:01:35 2009 +0000

    fold md5sum tests into shunit2 script

diff --git a/tests/runtests b/tests/runtests
index b03da96..96bff66 100755
--- a/tests/runtests
+++ b/tests/runtests
@@ -1,7 +1,7 @@
 #!/bin/sh
 
 test_verify_file_yes() {
-  ./tests/lib/verify_file "tests/verify_file"
+  ./tests/lib/verify_file "tests/runtests"
   assertEquals $? 0
 }
 test_verify_file_no() {
@@ -16,5 +16,13 @@ test_verify_dir_yes() {
   ./tests/lib/verify_directory "tests/does_not_exist"
   assertNotEquals $? 0
 }
+test_md5sum_yes() {
+  ./tests/lib/verify_md5sum "tests/testfile" "5d41402abc4b2a76b9719d911017c592"
+  assertEquals $? 0
+} 
+test_md5sum_no() {
+  ./tests/lib/verify_md5sum "tests/testfile" "incorrect"
+  assertNotEquals $? 0
+} 
 
 . ./tests/shunit2/shunit2
diff --git a/tests/testfile b/tests/testfile
new file mode 100644
index 0000000..b6fc4c6
--- /dev/null
+++ b/tests/testfile
@@ -0,0 +1 @@
+hello
\ No newline at end of file
diff --git a/tests/verify_md5sum b/tests/verify_md5sum
deleted file mode 100755
index 9a01e93..0000000
--- a/tests/verify_md5sum
+++ /dev/null
@@ -1,20 +0,0 @@
-#!/bin/sh
-set -u
-set -e
-
-correct="6f5902ac237024bdd0c176cb93063dc4"
-incorrect="wrong"
-
-workdir=$(mktemp -td game-data-packager.tests.XXXXXX)
-echo hello world > "$workdir/testfile"
-
-printf "verify_md5sum: "
-if   ./tests/lib/verify_md5sum "$workdir/testfile" "$correct" &&
-   ! ./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