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

オープン
#2,881 コメント 2 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 2 日以内に返信

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
35/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
cpp

調査の方向性

まず src/catch2/catch_config.cpp の 24-29 行目と 222-227 行目から始め、次に新しいアロケーションを拒否するテストを使って bazel test で失敗を再現します。enableBazelEnvSupport が reporter の動作をどのように変更するかを確認し、明示的なサポートは引き続き利用可能なまま、メモリ割り当てなしのテストがもう失敗しないことを検証します。

索引モデルが issue の本文から書いたものです。

説明

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.

主要言語
C++
スター
21.6k
フォーク
3.4k
平均マージ
3日 12時間
マージ済み PR(30日)
5

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

catchorg/Catch2 のほかの issue

catchorg/Catch2 の issue をすべて見る

似ている issue

C++ の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。