]> git.ozlabs.org Git - petitboot/blobdiff - devices/parser-test.sh
Add parser tests, clean up test system
[petitboot] / devices / parser-test.sh
diff --git a/devices/parser-test.sh b/devices/parser-test.sh
new file mode 100755 (executable)
index 0000000..351dc75
--- /dev/null
@@ -0,0 +1,20 @@
+#!/bin/bash
+
+testdir=devices/parser-tests
+
+function test_dir()
+{
+       dir="$1"
+       ./parser-test "$dir" 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"