]> git.ozlabs.org Git - petitboot/blobdiff - test/parser-test.sh
Fixup parser test program
[petitboot] / test / parser-test.sh
index 140601e70ad7de5cea7f6395931616cbbf11aaf5..af54395215ed57d754ea33614881aedc7aa05fbb 100755 (executable)
@@ -1,26 +1,25 @@
 #!/bin/bash
 
-testdir=devices/parser-tests
+testdir=parser
 default_rootdev=ps3da1
+mnt=${PREFIX}/var/petitboot/mnt
 
-function test_dir()
-{
-       dir="$1"
+#set -ex
+
+tests=$(ls ${mnt}/${testdir}/)
+
+for test in $tests
+do
        rootdev=$default_rootdev
-       if [ -e "$dir/rootdev" ]
-       then
-               rootdev=$(cat "$dir/rootdev")
+
+       if [ -e "${mnt}/${testdir}/$test/rootdev" ]; then
+               rootdev=$(cat "${mnt}/${testdir}/$test/rootdev")
        fi
-       ./parser-test "$dir" /dev/$rootdev 2>/dev/null |
-               diff -u "$dir/expected-output" -
-}
 
-set -ex
+       ./test/parser-test "${testdir}/$test" $rootdev
 
-for test in $testdir/*
-do
-       echo $test
-       test_dir "$test"
+#      ./test/parser-test "${testdir}/$test" $rootdev 2>/dev/null |
+#              diff -u "${mnt}/${testdir}/$test/expected-output" -
 done
 
 echo "All tests passed"