OSDN Git Service

* tests/lha-test.in, tests/lha-test2, tests/lha-test3, tests/lha-test4, tests/lha...
authorarai <arai@6a8cc165-1e22-0410-a132-eb4e3f353aba>
Sun, 11 Aug 2002 10:07:02 +0000 (10:07 +0000)
committerarai <arai@6a8cc165-1e22-0410-a132-eb4e3f353aba>
Sun, 11 Aug 2002 10:07:02 +0000 (10:07 +0000)
print filename when test failed.

git-svn-id: svn+ssh://svn.sourceforge.jp/svnroot/lha/lha/trunk@471 6a8cc165-1e22-0410-a132-eb4e3f353aba

13 files changed:
tests/lha-test.in
tests/lha-test10
tests/lha-test11
tests/lha-test12
tests/lha-test13
tests/lha-test2
tests/lha-test3
tests/lha-test4
tests/lha-test5
tests/lha-test6
tests/lha-test7
tests/lha-test8
tests/lha-test9

index 2af8fc0..961f309 100644 (file)
@@ -22,9 +22,9 @@ check() {
   typeset lineno=$2
   if [[ $status -eq 0 ]]; then
     message test $test_number ... ok
-    echo at line $lineno
+    echo at line $lineno in $FILENAME
   else
-    message test $test_number ... failed at line $lineno
+    message test $test_number ... failed at line $lineno in $FILENAME
     ((error_num = error_num + 1))
     error_tests="$error_tests #$test_number"
     result=1
@@ -39,6 +39,9 @@ cleanup()
 # create test data
 
 message testing $lha
+
+# the `FILENAME' variable should be set the each test filename.
+FILENAME=lha-test
 message testing to create/list/extract lha archive.
 
 typeset -i i=0
index 6768b99..94c08f2 100644 (file)
@@ -1,4 +1,5 @@
 # -*- shell-script -*-
+FILENAME=lha-test10
 message testing header level 0, 1, 2 and each generic headers
 $lha c0  test-tmp-h0.lzh test-1
                                                        check $? $LINENO
index 572542e..b52823d 100644 (file)
@@ -1,4 +1,5 @@
 # -*- shell-script -*-
+FILENAME=lha-test11
 message testing the long filename support
 # long long filename
 # assume that we are allowed to create 255 bytes filename (not path name).
index 75a7184..aec1256 100644 (file)
@@ -1,4 +1,5 @@
 # -*- shell-script -*-
+FILENAME=lha-test12
 message testing the end of line conversion.
 
 # NL to CR NL in archive
index 7414203..077d0e5 100644 (file)
@@ -1,4 +1,5 @@
 # -*- shell-script -*-
+FILENAME=lha-test13
 message testing the kanji code conversion.
 
 printf '\xb4\xc1\xbb\xfa\xc9\xbd\n' > test-tmp-euc
@@ -9,7 +10,7 @@ printf '\x8a\xbf\x8e\x9a\x95\x5c\n' > test-tmp-sjis
 $lha c test-tmp-euc.lzh test-tmp-euc
                                                        check $? $LINENO
 # file size is too small, so no compressed
-$lha v test-tmp-euc.lzh | grep lh0
+$lha v test-tmp-euc.lzh | egrep lh0
                                                        check $? $LINENO
 # no convert
 $lha xw=test-tmp-euc-d test-tmp-euc.lzh
@@ -30,7 +31,7 @@ test $? -ne 0
 $lha ce test-tmp-sjis.lzh test-tmp-euc
                                                        check $? $LINENO
 # file size is too small, so no compressed
-$lha v test-tmp-euc.lzh | grep lh0
+$lha v test-tmp-euc.lzh | egrep lh0
                                                        check $? $LINENO
 # no convert (CR NL to NL)
 $lha xtw=test-tmp-sjis-d test-tmp-sjis.lzh
@@ -53,7 +54,7 @@ done
 # no convert
 $lha c test-tmp-euc2.lzh test-tmp-euc2
                                                        check $? $LINENO
-$lha v test-tmp-euc2.lzh | grep 'lh[567]'
+$lha v test-tmp-euc2.lzh | egrep 'lh[567]'
                                                        check $? $LINENO
 # no convert
 $lha xw=test-tmp-euc2-d test-tmp-euc2.lzh
@@ -73,7 +74,7 @@ test $? -ne 0
 # euc to sjis (NL to CR NL)
 $lha ce test-tmp-sjis2.lzh test-tmp-euc2
                                                        check $? $LINENO
-$lha v test-tmp-euc2.lzh | grep 'lh[567]'
+$lha v test-tmp-euc2.lzh | egrep 'lh[567]'
                                                        check $? $LINENO
 # no convert (CR NL to NL)
 $lha xtw=test-tmp-sjis2-d test-tmp-sjis2.lzh
index af885d3..935e665 100644 (file)
@@ -1,4 +1,5 @@
 # -*- shell-script -*-
+FILENAME=lha-test2
 message testing to lh0, lh1, lh5, lh6 and lh7 method archive.
 $lha cz  test-tmp-m0.lzh test-a test-b test-c
                                                        check $? $LINENO
@@ -70,7 +71,7 @@ $lha pq test-tmp-m6.lzh | diff test-tmp-abc -
                                                        check $? $LINENO
 $lha pq test-tmp-m7.lzh | diff test-tmp-abc -
                                                        check $? $LINENO
-# 0 byte files should be frozen with the -lh0- method.
+# empty file should be frozen with the -lh0- method.
 touch test-tmp-0byte
                                                        check $? $LINENO
 $lha c test-tmp-0byte.lzh test-tmp-0byte
@@ -79,3 +80,12 @@ $lha v test-tmp-0byte.lzh
                                                        check $? $LINENO
 $lha v test-tmp-0byte.lzh | grep lh0
                                                        check $? $LINENO
+# uncompressed file should be frozen with the -lh0- method.
+echo foobar > test-tmp-small
+                                                       check $? $LINENO
+$lha c test-tmp-small.lzh test-tmp-small
+                                                       check $? $LINENO
+$lha v test-tmp-small.lzh
+                                                       check $? $LINENO
+$lha v test-tmp-small.lzh | grep lh0
+                                                       check $? $LINENO
index 35927f8..1fb1830 100644 (file)
@@ -1,4 +1,5 @@
 # -*- shell-script -*-
+FILENAME=lha-test3
 message testing to generic format archive.
 $lha czg  test-tmp-m0g.lzh test-a test-b test-c
                                                        check $? $LINENO
index b388170..bf7d15f 100644 (file)
@@ -1,4 +1,5 @@
 # -*- shell-script -*-
+FILENAME=lha-test4
 message testing to delete files from archive.
 
 cp test-1.lzh test-tmp.lzh
index 2b5ff7b..e595522 100644 (file)
@@ -1,4 +1,5 @@
 # -*- shell-script -*-
+FILENAME=lha-test5
 message testing to treat stdin/stdout as archive file.
 
 $lha c - test-a test-b test-c > test-tmp.lzh
index 0e99629..302716f 100644 (file)
@@ -1,4 +1,5 @@
 # -*- shell-script -*-
+FILENAME=lha-test6
 message testing to treat stdin/stdout as file list.
 message Warning: On MinGW, these tests will fail for now.
 cat <<EOF | $lha c test-tmp.lzh
index bb03c70..485daf7 100644 (file)
@@ -1,4 +1,5 @@
 # -*- shell-script -*-
+FILENAME=lha-test7
 message testing to add/update files to archive.
 $lha a test-tmp.lzh test-c
                                                        check $? $LINENO
index 5169083..47a7190 100644 (file)
@@ -1,4 +1,5 @@
 # -*- shell-script -*-
+FILENAME=lha-test8
 message testing timestamp
 # level 0 header
 $lha c0 test-tmp-h0.lzh test-[abc]
index 4acfa3b..5ed1901 100644 (file)
@@ -1,4 +1,5 @@
 # -*- shell-script -*-
+FILENAME=lha-test9
 message 'testing overriding existing files (this test need the Ruby interpreter http://www.ruby-lang.org/)'
 
 pty()