summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xtest/Scripts/count17
1 files changed, 17 insertions, 0 deletions
diff --git a/test/Scripts/count b/test/Scripts/count
new file mode 100755
index 0000000000..cc0355208b
--- /dev/null
+++ b/test/Scripts/count
@@ -0,0 +1,17 @@
+#!/bin/sh
+#
+# Program: count
+#
+# Synopsis: Count the number of lines of input on stdin and test that it
+# matches the specified number.
+#
+# Syntax: count <number>
+
+set -e
+set -u
+input_lines=$(wc -l)
+if [ "$input_lines" -ne "$1" ]; then
+ echo "count: expected $1 lines and got ${input_lines}."
+ exit 1
+fi
+exit 0