mirror of
https://github.com/bazel-contrib/bazel-lib
synced 2024-11-30 01:41:21 +00:00
31 lines
846 B
Bash
Executable file
31 lines
846 B
Bash
Executable file
#!/usr/bin/env bash
|
|
set -o errexit -o nounset -o pipefail
|
|
|
|
function run_test {
|
|
bazel run //:write_source_file_root-test
|
|
local expected_out="test-out/dist/write_source_file_root-test/test.txt"
|
|
if [ ! -e "$expected_out" ]; then
|
|
echo "ERROR: expected $expected_out to exist"
|
|
exit 1
|
|
fi
|
|
if [ -x "$expected_out" ]; then
|
|
echo "ERROR: expected $expected_out to not be executable"
|
|
exit 1
|
|
fi
|
|
expected_out="test-out/dist/write_source_file_root-test_b/test.txt"
|
|
if [ ! -e "$expected_out" ]; then
|
|
echo "ERROR: expected $expected_out to exist"
|
|
exit 1
|
|
fi
|
|
if [ -x "$expected_out" ]; then
|
|
echo "ERROR: expected $expected_out to not be executable"
|
|
exit 1
|
|
fi
|
|
}
|
|
|
|
# Run twice to make sure we can have permission to overwrite the outputs of a previous run
|
|
rm -Rf test-out
|
|
run_test
|
|
run_test
|
|
echo "All tests passed"
|