diff options
author | 2017-12-13 05:55:07 -0800 | |
---|---|---|
committer | 2017-12-13 05:56:34 -0800 | |
commit | a3b8e3972379f7e32f7c72c298ee20d8127f9aff (patch) | |
tree | dc1a64ec5513b329e81d3bd631cf92c468c47228 /src/test/shell | |
parent | 75eca48099370df836388a6afe0279d597673f33 (diff) |
Implement --(no)expand_test_suites flag.
--noexpand_test_suites flag will suppress expansion of test_suite
targets into constituent tests, so that command-line aspects can analyze
test_suite targets.
RELNOTES: Added --(no)expand_test_suites flag.
PiperOrigin-RevId: 178892829
Diffstat (limited to 'src/test/shell')
-rwxr-xr-x | src/test/shell/integration/test_test.sh | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/src/test/shell/integration/test_test.sh b/src/test/shell/integration/test_test.sh index d288fefa17..c2e599749b 100755 --- a/src/test/shell/integration/test_test.sh +++ b/src/test/shell/integration/test_test.sh @@ -128,4 +128,32 @@ EOF bazel test //dir:my_test &> $TEST_log || fail "expected test to pass" } +function test_test_suite_non_expansion() { + mkdir -p dir + cat > dir/BUILD <<'EOF' +sh_test(name = 'test_a', + srcs = [':a.sh'], +) + +sh_test(name = 'test_b', + srcs = [':b.sh'], +) + +test_suite(name = 'suite', +) +EOF + cat > dir/a.sh <<'EOF' +#!/bin/sh +exit 0 +EOF + + cat > dir/b.sh <<'EOF' +#!/bin/sh +exit 0 +EOF + chmod +x dir/a.sh dir/b.sh + bazel test --noexpand_test_suites //dir:suite &> $TEST_log || fail "expected test to pass" + expect_log '//dir:test_a' + expect_log '//dir:test_b' +} run_suite "test tests" |