Steps throwing exceptions not reported as an error (Boost.Test)
まだ誰も着手していません。
評価
調査の方向性
BoostDriver の runWithMasterSuite() の呼び出しを特定し、例外が捕捉されて observer に報告される unit_test_monitor.ipp を確認します。driver が step の成功をどのように判定しているかを確認し、Boost.Test results_collector の出力と比較します。例外をスローする step が成功ではなく失敗として報告され、失敗の詳細が cucumber-cpp に公開されれば完了です。
索引モデルが issue の本文から書いたものです。
説明
Summary
We encountered the issue that step definitions which throw an exception are reported as passed, when using the Boost.Test framework and cucumber-cpp.
Expected Behavior
Our expectation was that a step which throws an exception (for whatever reason) should be reported as a failed step by cucumber-cpp.
Current Behavior
The step is reported as passed. The rest of the step definition after the exception gets thrown, doesn't get executed.
Possible Solution
Not familiar with Boost.Test nor cucumber-cpp source code, but while debugging this, I noticed the following:
The exception is caught by unit_test_monitor_t::execute_and_translate(...) in unit_test_monitor.ipp and gets reported to test observers.
However, the BoostDriver only considers the test log for the decision to rate a step as success or failure, but exceptions don't show up in this log for some reason.
We could successfully trigger a failed step by adding something along the following lines after runWithMasterSuite() (needs #include <boost/test/results_collector.hpp>):
auto results = ::boost::unit_test::results_collector.results(testCase->p_id);
if (!results.passed())
{
std::string description = "Test aborted/failed with result code " + std::to_string(results.result_code());
return InvokeResult::failure(description.c_str());
}
- 主要言語
- C++
- スター
- 330
- フォーク
- 142
- 平均マージ
- 2日 8時間
- マージ済み PR(30日)
- 2
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
cucumber/cucumber-cpp のほかの issue
-
難易度 3/5 1〜2日 初心者へのやさしさ 45/100
cucumber/cucumber-cpp#317 ·
-
難易度 5/5 1週間以上 初心者へのやさしさ 20/100
cucumber/cucumber-cpp#313 · コメント 9 件 ·
-
Authorize hyphen "-" for Tag再び着手できるかも @ursfassler が 399 日前に担当しましたが、オープン中のプルリクエストはありません。 オープンbug
cucumber/cucumber-cpp#312 · コメント 4 件 · 担当者 1 名 ·
-
feature
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
cucumber/cucumber-cpp#304 · コメント 2 件 ·
-
help
難易度 4/5 3〜5日 初心者へのやさしさ 25/100
cucumber/cucumber-cpp#302 · コメント 1 件 ·
cucumber/cucumber-cpp の issue をすべて見る
似ている issue
-
Build fails on macOS 27: dyld refuses stripped Rust proc-macros (mis-aligned LINKEDIT string pool)オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 73/100
cloudflare/workerd#8963 ·
メンテナーはふだん 1 日以内に返信
-
Android Bug Core Drape
難易度 2/5 1〜3時間 初心者へのやさしさ 77/100
organicmaps/organicmaps#14449 ·
メンテナーはふだん 1 日以内に返信
-
comp-codecs
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
ClickHouse/ClickHouse#135159 ·
メンテナーはふだん 1 日以内に返信
-
category:port-update
難易度 2/5 1〜3時間 初心者へのやさしさ 64/100
メンテナーはふだん 2 日以内に返信
-
difficulty:easy func:python os:windows prio:high type:bug
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
NatronGitHub/Natron#2029 ·
メンテナーはふだん 1 日以内に返信