| 400 | } |
| 401 | |
| 402 | absl::Status TestRunner::EnableCoverage() { |
| 403 | if (test_context_ != nullptr && test_context_->enable_coverage()) { |
| 404 | coverage_index_ = std::make_unique<CoverageIndex>(); |
| 405 | |
| 406 | if (test_context_->runtime() != nullptr) { |
| 407 | auto* runtime = const_cast<cel::Runtime*>(test_context_->runtime()); |
| 408 | CEL_RETURN_IF_ERROR(EnableCoverageInRuntime(*runtime, *coverage_index_)); |
| 409 | } else if (test_context_->cel_expression_builder() != nullptr) { |
| 410 | auto* builder = |
| 411 | const_cast<google::api::expr::runtime::CelExpressionBuilder*>( |
| 412 | test_context_->cel_expression_builder()); |
| 413 | CEL_RETURN_IF_ERROR( |
| 414 | EnableCoverageInCelExpressionBuilder(*builder, *coverage_index_)); |
| 415 | } |
| 416 | } |
| 417 | return absl::OkStatus(); |
| 418 | } |
| 419 | |
| 420 | void TestRunner::RunTest(const TestCase& test_case) { |
| 421 | // The arena has to be declared in RunTest because cel::Value returned by |
nothing calls this directly
no test coverage detected