OSDN Git Service

should include sys/types.h for mode_t
[lha/olha.git] / test.sh
diff --git a/test.sh b/test.sh
index 00044b0..924f88c 100644 (file)
--- a/test.sh
+++ b/test.sh
@@ -2,9 +2,26 @@
 
 set -ex
 
-cp olha.exe olha2
-./olha a foo.lzh olha2
+VALGRIND=
+if [ "$1" = -v ]; then
+  if which valgrind 2>/dev/null; then
+    VALGRIND="valgrind -q"
+  fi
+fi
+
+if [ -f olha.exe ]; then
+  cp olha.exe olha2
+else
+  cp olha olha2
+fi
+$VALGRIND ./olha a foo.lzh olha2
 lha t foo.lzh
-./olha x foo.lzh olha2
-diff olha.exe olha2
+./olha l foo.lzh
+./olha xf foo.lzh olha2
+if [ -f olha.exe ]; then
+  diff olha.exe olha2
+else
+  diff olha olha2
+fi
+./olha a foo.lzh olha2
 rm -f olha2 foo.lzh