diff options
author | 2017-11-01 13:48:46 -0400 | |
---|---|---|
committer | 2017-11-02 10:04:11 -0400 | |
commit | a0e5b2f4c4312685284e9fbe9be5a4f991eb60b3 (patch) | |
tree | d0abef9903c4dd6652daa11d391b336e9bc45d61 /src/test/shell | |
parent | 3dfcfb1d3c75ee71b654a5950904012d28340269 (diff) |
Don't require --keep_going to discard graph edges. It's unnecessary.
PiperOrigin-RevId: 174202685
Diffstat (limited to 'src/test/shell')
-rw-r--r-- | src/test/shell/integration/discard_graph_edges_lib.sh | 2 | ||||
-rwxr-xr-x | src/test/shell/integration/discard_graph_edges_test.sh | 23 |
2 files changed, 18 insertions, 7 deletions
diff --git a/src/test/shell/integration/discard_graph_edges_lib.sh b/src/test/shell/integration/discard_graph_edges_lib.sh index 84770166ea..e5bea5ba47 100644 --- a/src/test/shell/integration/discard_graph_edges_lib.sh +++ b/src/test/shell/integration/discard_graph_edges_lib.sh @@ -17,7 +17,7 @@ # discard_graph_edges_lib.sh: functions needed by discard_graph_edges_test.sh STARTUP_FLAGS="--batch" -BUILD_FLAGS="--keep_going --discard_analysis_cache" +BUILD_FLAGS="--discard_analysis_cache" function extract_histogram_count() { local histofile="$1" diff --git a/src/test/shell/integration/discard_graph_edges_test.sh b/src/test/shell/integration/discard_graph_edges_test.sh index 3857256a0b..7cc2d8435b 100755 --- a/src/test/shell/integration/discard_graph_edges_test.sh +++ b/src/test/shell/integration/discard_graph_edges_test.sh @@ -46,6 +46,22 @@ function test_test() { || fail "Expected success" } +function test_failed_build() { + mkdir -p foo || fail "Couldn't make directory" + cat > foo/BUILD <<'EOF' || fail "Couldn't make BUILD file" +cc_library(name = 'foo', srcs = ['foo.cc'], deps = [':bar']) +cc_library(name = 'bar', srcs = ['bar.cc']) +EOF + touch foo/foo.cc || fail "Couldn't make foo.cc" + echo "#ERROR" > foo/bar.cc || fail "Couldn't make bar.cc" + bazel $STARTUP_FLAGS build $BUILD_FLAGS //foo:foo >& "$TEST_log" \ + && fail "Expected failure" + exit_code=$? + [ $exit_code -eq 1 ] || fail "Wrong exit code: $exit_code" + expect_log "#ERROR" + expect_not_log "Graph edges not stored" +} + # bazel info inherits from bazel build, but it doesn't have much in common with it. function test_info() { bazel $STARTUP_FLAGS info $BUILD_FLAGS >& $TEST_log || fail "Expected success" @@ -265,7 +281,7 @@ genrule(name='foo', EOF # --nocache_test_results to make log-grepping easier. - bazel $STARTUP_FLAGS test $BUILD_FLAGS \ + bazel $STARTUP_FLAGS test --keep_going $BUILD_FLAGS \ --nocache_test_results //conflict:foo //testing:mytest >& $TEST_log \ && fail "Expected failure" exit_code=$? @@ -305,11 +321,6 @@ function test_no_batch() { || fail "Expected success" } -function test_no_keep_going() { - bazel $STARTUP_FLAGS test $BUILD_FLAGS --nokeep_going //testing:mytest >& $TEST_log \ - || fail "Expected success" -} - function test_no_discard_analysis_cache() { bazel $STARTUP_FLAGS test $BUILD_FLAGS --nodiscard_analysis_cache //testing:mytest >& $TEST_log \ || fail "Expected success" |