Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Bazel XML_OUTPUT_FILE processing to main #2333

Closed
wants to merge 1 commit into from

Commits on Dec 15, 2021

  1. Add Bazel XML_OUTPUT_FILE processing to main

    `bazel test` sets the `XML_OUTPUT_FILE` environment variable which
    specifies where the JUnit output of the test executable should be
    written.
    
    Picking up this variable allows catch2 to naturally integrate into
    the Bazel testing ecosystem out-of-the-box.
    
    The environment variable processing is hidden behind the
    `CATCH_CONFIG_MAIN_BAZEL_XML_OUTPUT_FILE` define and it _only_
    enabled in the `BUILD.bazel`.
    
    This allows the Bazel ecosystem to create a `cc_test` target as
    follows:
    
    ```
    cc_test(
        name = "some_test",
        deps = ["@catch2//:catch2_main"],
        srcs = globs("**/*_test.cpp"),
    )
    ```
    
    The output will be written to `bazel-testlogs/some_test/test.xml`
    mattyclarkson committed Dec 15, 2021
    Configuration menu
    Copy the full SHA
    f1c5e9f View commit details
    Browse the repository at this point in the history