aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/test/shell
diff options
context:
space:
mode:
authorGravatar dslomov <dslomov@google.com>2017-12-13 05:55:07 -0800
committerGravatar Copybara-Service <copybara-piper@google.com>2017-12-13 05:56:34 -0800
commita3b8e3972379f7e32f7c72c298ee20d8127f9aff (patch)
treedc1a64ec5513b329e81d3bd631cf92c468c47228 /src/test/shell
parent75eca48099370df836388a6afe0279d597673f33 (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-xsrc/test/shell/integration/test_test.sh28
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"