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

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


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