mirror of
https://github.com/bazel-contrib/bazel-lib
synced 2024-12-03 11:52:43 +00:00
32 lines
892 B
Bash
32 lines
892 B
Bash
|
#!/usr/bin/env bash
|
||
|
set -o errexit -o nounset -o pipefail
|
||
|
|
||
|
function run_test {
|
||
|
bazel run //lib/tests/write_source_files:write_dist
|
||
|
local expected_out="lib/tests/write_source_files/dist.js"
|
||
|
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
|
||
|
|
||
|
bazel run //lib/tests/write_source_files:write_dist_executable
|
||
|
local expected_out="lib/tests/write_source_files/dist_executable.js"
|
||
|
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 be executable"
|
||
|
exit 1
|
||
|
fi
|
||
|
}
|
||
|
|
||
|
# Run twice to make sure we can have permission to overwrite the outputs of a previous run
|
||
|
run_test
|
||
|
run_test
|
||
|
echo "All tests passed"
|