| 59 | using ::testing::HasSubstr; |
| 60 | |
| 61 | std::unique_ptr<cel::CompilerBuilder> MakeDefaultCompilerBuilder() { |
| 62 | google::protobuf::LinkMessageReflection<AttributeContext>(); |
| 63 | auto builder = |
| 64 | cel::NewCompilerBuilder(google::protobuf::DescriptorPool::generated_pool()); |
| 65 | ABSL_CHECK_OK(builder.status()); |
| 66 | |
| 67 | ABSL_CHECK_OK((*builder)->AddLibrary(cel::StandardCompilerLibrary())); |
| 68 | ABSL_CHECK_OK((*builder)->GetCheckerBuilder().AddContextDeclaration( |
| 69 | "google.rpc.context.AttributeContext")); |
| 70 | |
| 71 | return std::move(builder).value(); |
| 72 | } |
| 73 | |
| 74 | TEST(DefaultCompiler, Basic) { |
| 75 | ASSERT_OK_AND_ASSIGN(auto compiler, MakeDefaultCompilerBuilder()->Build()); |
no test coverage detected