MCPcopy Create free account
hub / github.com/cel-expr/cel-cpp / RunTest

Method RunTest

testing/testrunner/runner_lib.cc:420–442  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

418}
419
420void TestRunner::RunTest(const TestCase& test_case) {
421 // The arena has to be declared in RunTest because cel::Value returned by
422 // EvalWithRuntime or EvalWithCelExpressionBuilder might contain pointers to
423 // the arena. The arena has to be alive during the assertion.
424 google::protobuf::Arena arena;
425 ASSERT_THAT(EnableCoverage(), absl_testing::IsOk());
426 ASSERT_OK_AND_ASSIGN(CheckedExpr checked_expr, GetCheckedExpr());
427
428 if (coverage_index_) {
429 coverage_index_->Init(checked_expr);
430 }
431
432 if (test_context_->runtime() != nullptr) {
433 ASSERT_OK_AND_ASSIGN(cel::Value result,
434 EvalWithRuntime(checked_expr, test_case, &arena));
435 ASSERT_NO_FATAL_FAILURE(Assert(result, test_case, &arena));
436 } else if (test_context_->cel_expression_builder() != nullptr) {
437 ASSERT_OK_AND_ASSIGN(
438 cel::Value result,
439 EvalWithCelExpressionBuilder(checked_expr, test_case, &arena));
440 ASSERT_NO_FATAL_FAILURE(Assert(result, test_case, &arena));
441 }
442}
443} // namespace cel::test

Callers 3

TEST_PFunction · 0.80
TESTFunction · 0.80
TestBodyFunction · 0.80

Calls 3

InitMethod · 0.80
runtimeMethod · 0.80

Tested by 3

TEST_PFunction · 0.64
TESTFunction · 0.64
TestBodyFunction · 0.64