about summary refs log tree commit diff
path: root/third_party/bazel/rules_nixpkgs/tests/test_output.sh
diff options
context:
space:
mode:
authorVincent Ambo <tazjin@google.com>2019-07-04T10·18+0100
committerVincent Ambo <tazjin@google.com>2019-07-04T10·18+0100
commit64275e446e442c9a0a860969501158ed93058441 (patch)
tree482821738cbc68fb1e7c263bc80a2cea4a946a66 /third_party/bazel/rules_nixpkgs/tests/test_output.sh
parentf723b8b878a3c4a4687b9e337a875500bebb39b1 (diff)
feat(third_party/bazel): Check in rules_nixpkgs from Tweag r/18
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 0000000000..29f2735cf4
--- /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