Skip to content

Commit f664b23

Browse files
Don't throw FAILED message when we have UNDEFINED scenarios.
Signed-off-by: NeaguGeorgiana23 <neagugeorgiana@google.com>
1 parent 818f258 commit f664b23

2 files changed

Lines changed: 23 additions & 1 deletion

File tree

test/e2e/cwt_extension.bzl

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,10 @@ genrule(
2222
2323
cc_library(
2424
name = "cwt-cucumber",
25-
srcs = glob(["src/**/*.cpp"]),
25+
srcs = glob(
26+
["src/**/*.cpp"],
27+
exclude =["src/main.cpp"]
28+
),
2629
hdrs = glob([
2730
"src/**/*.hpp",
2831
]) +[

test/e2e/steps/minimal_steps.cpp

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -299,5 +299,24 @@ THEN(check_resolved_flag_empty_ctx,
299299
EXPECT_EQ(actual, expected);
300300
}
301301

302+
// This function helps the test not to fail if we have an "UNDEFINED" scenario.
303+
// It should be deleted when we are able to write steps for all scenarios.
304+
int main(int argc, char* argv[]) {
305+
GTEST_FLAG_SET(throw_on_failure, true);
306+
::testing::InitGoogleMock(&argc, argv);
307+
308+
cuke::cwt_cucumber cucumber(argc, const_cast<const char**>(argv));
309+
310+
cucumber.run_tests();
311+
312+
cucumber.print_results();
313+
314+
if (::testing::UnitTest::GetInstance()->failed_test_count() > 0) {
315+
return 1;
316+
}
317+
318+
return 0;
319+
}
320+
302321
// TODO: Enable more Gherkin scenarios as the SDK functionality expands, e.g.
303322
// around event hooks, detailed evaluation, etc.

0 commit comments

Comments
 (0)