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

Abierto
#2,881 2 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 2 días

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
35/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Estancado
Stack tecnológico
cpp

Línea de trabajo

Comienza con src/catch2/catch_config.cpp en las líneas 24-29 y 222-227, y luego reproduce el fallo usando bazel test con una prueba que rechace nuevas asignaciones. Comprueba cómo enableBazelEnvSupport cambia el comportamiento del reporter y verifica que las pruebas sin asignaciones de memoria dejen de fallar, mientras el soporte explícito siga estando disponible.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

Describe the bug

Executing a test with Bazel that requires a memory allocation free test execution breaks due to the memory allocation done here.

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.

Lenguaje dominante
C++
Estrellas
21.6k
Forks
3.4k
Merge medio
3 d 12 h
PR fusionados (30 d)
5

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de catchorg/Catch2

Todos los issues de catchorg/Catch2

Issues similares

Más issues de C++

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.