Merge branch 'master' of feistymeow.org:feisty_meow
[feisty_meow.git] / scripts / testing / run_test_and_verify.sh
diff --git a/scripts/testing/run_test_and_verify.sh b/scripts/testing/run_test_and_verify.sh
new file mode 100644 (file)
index 0000000..6ca02e6
--- /dev/null
@@ -0,0 +1,13 @@
+#!/bin/bash
+
+# a simple unit test component that takes three parameters: the test to run, the
+# input file to give that test, and the expected correct output file from the test.
+# the script will complain if there is an error in the test output.  otherwise it
+# says nothing, but the script's return value can also be checked.
+
+to_run="$1"; shift
+input_file="$1"; shift
+answer_file="$1"; shift
+
+eval "$to_run" < "$input_file" | bash "$FEISTY_MEOW_SCRIPTS/testing/verify_correct_input.sh" "$answer_file"
+