aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/test
diff options
context:
space:
mode:
Diffstat (limited to 'src/test')
-rw-r--r--src/test/java/com/google/devtools/build/lib/actions/BaseSpawnTest.java5
-rwxr-xr-xsrc/test/shell/bazel/bazel_test_test.sh25
2 files changed, 29 insertions, 1 deletions
diff --git a/src/test/java/com/google/devtools/build/lib/actions/BaseSpawnTest.java b/src/test/java/com/google/devtools/build/lib/actions/BaseSpawnTest.java
index 72fc7e9d25..07abe5283a 100644
--- a/src/test/java/com/google/devtools/build/lib/actions/BaseSpawnTest.java
+++ b/src/test/java/com/google/devtools/build/lib/actions/BaseSpawnTest.java
@@ -18,6 +18,7 @@ import static com.google.common.truth.Truth.assertThat;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
+import com.google.common.collect.ImmutableSet;
import com.google.devtools.build.lib.analysis.Runfiles;
import com.google.devtools.build.lib.analysis.RunfilesSupplierImpl;
import com.google.devtools.build.lib.testutil.Scratch;
@@ -130,7 +131,9 @@ public class BaseSpawnTest {
ImmutableMap.<String, String>of(),
runfilesManifests,
runfilesSupplier,
- null, null);
+ null,
+ null,
+ ImmutableSet.<PathFragment>of());
}
private static Artifact mkArtifact(String path, Root rootDir) {
diff --git a/src/test/shell/bazel/bazel_test_test.sh b/src/test/shell/bazel/bazel_test_test.sh
index 9e7f609fe8..92c57e8c4b 100755
--- a/src/test/shell/bazel/bazel_test_test.sh
+++ b/src/test/shell/bazel/bazel_test_test.sh
@@ -243,4 +243,29 @@ EOF
done
}
+# Tests that the test.xml is extracted from the sandbox correctly.
+function test_xml_is_present() {
+ mkdir -p dir
+
+ cat <<'EOF' > dir/test.sh
+#!/bin/sh
+echo HELLO > $XML_OUTPUT_FILE
+exit 0
+EOF
+
+ chmod +x dir/test.sh
+
+ cat <<'EOF' > dir/BUILD
+ sh_test(
+ name = "test",
+ srcs = [ "test.sh" ],
+ )
+EOF
+
+ bazel test -s --test_output=streamed //dir:test &> $TEST_log || fail "expected success"
+
+ xml_log=bazel-testlogs/dir/test/test.xml
+ [ -s $xml_log ] || fail "$xml_log was not present after test"
+}
+
run_suite "test tests"