diff options
Diffstat (limited to 'test/parser-test.sh')
-rwxr-xr-x | test/parser-test.sh | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/test/parser-test.sh b/test/parser-test.sh new file mode 100755 index 0000000..140601e --- /dev/null +++ b/test/parser-test.sh @@ -0,0 +1,26 @@ +#!/bin/bash + +testdir=devices/parser-tests +default_rootdev=ps3da1 + +function test_dir() +{ + dir="$1" + rootdev=$default_rootdev + if [ -e "$dir/rootdev" ] + then + rootdev=$(cat "$dir/rootdev") + fi + ./parser-test "$dir" /dev/$rootdev 2>/dev/null | + diff -u "$dir/expected-output" - +} + +set -ex + +for test in $testdir/* +do + echo $test + test_dir "$test" +done + +echo "All tests passed" |