Skip to content

Commit

Permalink
Export BAZEL_XML_OUTPUT_FILE
Browse files Browse the repository at this point in the history
[Catch2][catch2] has [learnt][pr2399] how to output JUnit to the `XML_OUTPUT_FILE`. However, the upstream developers
[felt][comment] that `XML_OUTPUT_FILE` is too generic to blanket enable JUnit output to the file as there are various
XML reporters for Catch2.

This patch enables prefixing the `XML_OUTPUT_FILE` environment variable with `BAZEL_` so that Catch2 can enable JUnit
output support unconditionally in their build.

[catch2]: https://github.com/catchorg/Catch2
[pr2399]: catchorg/Catch2#2399
[comment]: catchorg/Catch2#2399 (comment)
  • Loading branch information
mattyclarkson committed May 3, 2022
1 parent ae349e9 commit def2219
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tools/test/test-setup.sh
Expand Up @@ -68,6 +68,10 @@ is_absolute "$TEST_TMPDIR" || TEST_TMPDIR="$PWD/$TEST_TMPDIR"
is_absolute "$HOME" || HOME="$TEST_TMPDIR"
is_absolute "$XML_OUTPUT_FILE" || XML_OUTPUT_FILE="$PWD/$XML_OUTPUT_FILE"

# Enable JUnit output in test frameworks that need to detect Bazel
BAZEL_XML_OUTPUT_FILE="$XML_OUTPUT_FILE"
export BAZEL_XML_OUTPUT_FILE

# Set USER to the current user, unless passed by Bazel via --test_env.
if [[ -z "$USER" ]]; then
export USER=$(whoami)
Expand Down

0 comments on commit def2219

Please sign in to comment.