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

Function StdLibCompiler

validator/homogeneous_literal_validator_test.cc:40–53  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

38using ::testing::HasSubstr;
39
40absl::StatusOr<std::unique_ptr<Compiler>> StdLibCompiler() {
41 CEL_ASSIGN_OR_RETURN(
42 auto builder,
43 NewCompilerBuilder(internal::GetSharedTestingDescriptorPool()));
44 builder->AddLibrary(StandardCompilerLibrary()).IgnoreError();
45 builder->AddLibrary(OptionalCompilerLibrary()).IgnoreError();
46 builder->AddLibrary(extensions::StringsCompilerLibrary()).IgnoreError();
47 cel::Type message_type = cel::Type::Message(
48 builder->GetCheckerBuilder().descriptor_pool()->FindMessageTypeByName(
49 "cel.expr.conformance.proto3.TestAllTypes"));
50 CEL_RETURN_IF_ERROR(builder->GetCheckerBuilder().AddVariable(
51 MakeVariableDecl("msg", message_type)));
52 return builder->Build();
53}
54
55struct TestCase {
56 std::string expression;

Callers

nothing calls this directly

Calls 8

StandardCompilerLibraryFunction · 0.85
OptionalCompilerLibraryFunction · 0.85
StringsCompilerLibraryFunction · 0.85
MakeVariableDeclFunction · 0.85
AddVariableMethod · 0.80
AddLibraryMethod · 0.45
descriptor_poolMethod · 0.45
BuildMethod · 0.45

Tested by

no test coverage detected