about summary refs log tree commit diff
path: root/third_party/bazel/rules_nixpkgs/tests/test_output.sh
diff options
context:
space:
mode:
Diffstat (limited to 'third_party/bazel/rules_nixpkgs/tests/test_output.sh')
-rwxr-xr-xthird_party/bazel/rules_nixpkgs/tests/test_output.sh15
1 files changed, 15 insertions, 0 deletions
diff --git a/third_party/bazel/rules_nixpkgs/tests/test_output.sh b/third_party/bazel/rules_nixpkgs/tests/test_output.sh
new file mode 100755
index 000000000000..29f2735cf4ca
--- /dev/null
+++ b/third_party/bazel/rules_nixpkgs/tests/test_output.sh
@@ -0,0 +1,15 @@
+#!/bin/sh
+# first param is the expected number of files given by `locations`
+expected_length="$1"
+
+# rest of the arguments are files
+shift
+no_of_files=$#
+
+if [ "$no_of_files" -ne "$expected_length" ]; then
+    echo "Should have received $expected_length files, but got $no_of_files:"
+    for f in "$@"; do
+        echo "$f"
+    done
+    exit 1
+fi