aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/test
diff options
context:
space:
mode:
authorGravatar Damien Martin-Guillerez <dmarting@google.com>2016-01-19 12:59:05 +0000
committerGravatar Lukacs Berki <lberki@google.com>2016-01-19 13:29:04 +0000
commitfbe0be3dbc6c7f3e5605e66c83be91793ada216a (patch)
treeed87110d2558c8f1d688e2a79ebe3e10a3692cbd /src/test
parent1903d7048a86aa0ff10e72f27e578eec30276aa9 (diff)
Use a separate XML_OUTPUT_FILE for unittest.bash tests
The current set-up was overwriting the XML_OUTPUT_FILE of unittest_test, leading to weird error on ci.bazel.io. -- MOS_MIGRATED_REVID=112462362
Diffstat (limited to 'src/test')
-rwxr-xr-xsrc/test/shell/unittest_test.sh7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/test/shell/unittest_test.sh b/src/test/shell/unittest_test.sh
index 9cbb8f36dc..70f4aca1c3 100755
--- a/src/test/shell/unittest_test.sh
+++ b/src/test/shell/unittest_test.sh
@@ -50,6 +50,7 @@ function test_failure_message() {
cd $TEST_TMPDIR
cat > thing.sh <<EOF
#!/bin/bash
+XML_OUTPUT_FILE=${TEST_TMPDIR}/dummy.xml
source ${DIR}/unittest.bash
function test_thing() {
@@ -61,13 +62,14 @@ EOF
chmod +x thing.sh
./thing.sh &> $TEST_log && fail "thing.sh should fail"
expect_not_log "__fail: No such file or directory"
- assert_contains "I'm a failure." $XML_OUTPUT_FILE
+ assert_contains "I'm a failure." ${TEST_TMPDIR}/dummy.xml
}
function test_no_failure_message() {
cd $TEST_TMPDIR
cat > thing.sh <<EOF
#!/bin/bash
+XML_OUTPUT_FILE=${TEST_TMPDIR}/dummy.xml
source ${DIR}/unittest.bash
function test_thing() {
@@ -79,13 +81,14 @@ EOF
chmod +x thing.sh
./thing.sh &> $TEST_log && fail "thing.sh should fail"
expect_not_log "__fail: No such file or directory"
- assert_contains "No failure message" $XML_OUTPUT_FILE
+ assert_contains "No failure message" ${TEST_TMPDIR}/dummy.xml
}
function test_errexit_prints_stack_trace() {
cd $TEST_TMPDIR
cat > thing.sh <<EOF
#!/bin/bash
+XML_OUTPUT_FILE=${TEST_TMPDIR}/dummy.xml
source ${DIR}/unittest.bash
enable_errexit