aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/test/shell
diff options
context:
space:
mode:
authorGravatar Kristina Chodorow <kchodorow@google.com>2016-01-06 20:31:03 +0000
committerGravatar Philipp Wollermann <philwo@google.com>2016-01-07 13:46:57 +0000
commitf627562e351717b1b207f0afb65c4f855bf664ef (patch)
tree2e8de96c8880c657697f6aa7e21b9cb04b7aa580 /src/test/shell
parenteb0d376beb618790c0526e80df5375248e875b8c (diff)
Stop parsing the WORKSPACE file when a parse error is detected
Parsing was continuing and tried to load skylark extensions even though an error was present in the WORKSPACE file. Fixes #724 -- MOS_MIGRATED_REVID=111534382
Diffstat (limited to 'src/test/shell')
-rwxr-xr-xsrc/test/shell/bazel/workspace_test.sh14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/test/shell/bazel/workspace_test.sh b/src/test/shell/bazel/workspace_test.sh
index 2fd56fa1e2..0cd927459b 100755
--- a/src/test/shell/bazel/workspace_test.sh
+++ b/src/test/shell/bazel/workspace_test.sh
@@ -106,4 +106,18 @@ EOF
check_eq "12" "$(cat bazel-genfiles/test.out | tr -d '[[:space:]]')"
}
+# Regression test for issue #724: NullPointerException in WorkspaceFile
+function test_error_in_workspace_file() {
+ # Create a buggy workspace
+ cat >WORKSPACE <<'EOF'
+/
+EOF
+
+ # Try to refer to the workspace.
+ bazel --batch build @r//:rfg &>$TEST_log \
+ && fail "Failure expected" || true
+
+ expect_not_log "Exception"
+}
+
run_suite "workspace tests"