catchorg / catchorg/Catch2

`enableBazelEnvSupport` behavior breaks test executions relying on memory allocation free test execution

Open
#2,881 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
21.5k
Forks
3.5k
Avg merge
3d 16h
Merged PRs (30d)
2

Description

**Describe the bug**

Executing a test with Bazel that requires a memory allocation free test execution breaks due to the memory allocation done [here](https://github.com/catchorg/Catch2/blob/4e8d92bf02f7d1c8006a0e7a5ecabd8e62d98502/src/catch2/catch_config.cpp#L222-L227).

**Expected behavior**

The test framework should not behave differently based on the build system that is used.
Ideally, Bazel would set the xml reporter in case it detects catch.
Since this is beyond the scope of this issue, an alternative solution would be to give the user the option to disable this behavior.
Currently, you can only enable this explicitly or it is automatically enabled if used with Bazel: https://github.com/catchorg/Catch2/blob/4e8d92bf02f7d1c8006a0e7a5ecabd8e62d98502/src/catch2/catch_config.cpp#L24C21-L29

**Reproduction steps**
Steps to reproduce the bug.

- Have a function that fails/throws if someone uses `new`
- Execture the test with `bazel test`
- Boom

**Platform information:**

- OS: Ubuntu 20.04
- Compiler+version: GCC 9.3 / Clang 12
- Catch version: tested with 3.1.0 and 3.6.0 (but should happen with 3.x)

**Additional context**
Add any other context about the problem here.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.