]> git.draconx.ca Git - liblbx.git/blobdiff - tests/regress.sh
build: Use a non-recursive makefile.
[liblbx.git] / tests / regress.sh
index 9c56d776ab8cb9a95c239bf985ab5256776213ec..a752bac3488cbd71037cb33e82f779a1de569882 100755 (executable)
@@ -6,11 +6,11 @@
 # Image/tool paths.  Adjust to taste.  The DATADIR must contain the original
 # Moo2 LBX archives, with filenames in lower case.
 DATADIR=$HOME/.2oom/game
-LBXTOOL="`readlink -f ../src/lbxtool`"
-LBXIMG="`readlink -f ../src/lbximg`"
+LBXTOOL="`readlink -f ../lbxtool`"
+LBXIMG="`readlink -f ../lbximg`"
 
 # Status vars
-FAILED=""
+FAILED=0
 
 if ! SCRATCH="`mktemp -d`"; then
        exit 1
@@ -32,7 +32,7 @@ compare()
                rm -f "$FILE"
        else
                echo "FAILED"
-               FAILED="yes"
+               FAILED=`expr $FAILED + 1`
        fi
 }
 
@@ -56,9 +56,9 @@ compare 49 390c49cfd1fe5e2ac0490be976f20936
 # Logos
 $LBXTOOL -xf $DATADIR/logo.lbx 
 
-echo "logo.lbx.000: single frame, embedded palette:"
+echo "logo.lbx.000: single frame, embedded palette, transparency:"
 $LBXIMG -df logo.lbx.000
-compare 0 75f9e5a7205192b414f009424ffb7dc3
+compare 0 5cc8d2b761390d15be2738030c658bfc
 
 echo "logo.lbx.001: multi frame, embedded palette:"
 $LBXIMG -df logo.lbx.001 0 30 63
@@ -66,5 +66,17 @@ compare  0 f3f0859b39f2e76091842c8a7276b2a1
 compare 30 8fb41356a20c68c3be0939ad49256cf9
 compare 63 156f381c5d4bf6178affd3d6a4720118
 
+# Ships
+$LBXTOOL -xf $DATADIR/ships.lbx ships.lbx.{042,049}
+
+echo "ships.lbx.042: single frame, external+override palette, transparency:"
+$LBXIMG -df ships.lbx.042 -p fonts.lbx.012 -O ships.lbx.049
+compare 0 bd643736d46ef387bcffcc8803aabb83
+
 # Clean up
-[ -z "$FAILED" ] && rm -rf -- "$SCRATCH"
+if [ $FAILED -eq 0 ]; then
+       echo "All tests completed successfully."
+       rm -rf -- "$SCRATCH"
+else
+       echo "$FAILED test(s) FAILED"
+fi