()
| 75 | ) |
| 76 | |
| 77 | func init() { |
| 78 | flag.BoolVar(&dashboard, "dashboard", false, "Dashboard.") |
| 79 | flag.Var(&tests, "tests", "Paths to run, separate by a comma.") |
| 80 | flag.Var(&skipTests, "skip_tests", "Tests to skip, separate by a comma.") |
| 81 | |
| 82 | stdOpts := []cel.EnvOption{ |
| 83 | cel.StdLib(), |
| 84 | cel.ClearMacros(), |
| 85 | cel.OptionalTypes(), |
| 86 | cel.EagerlyValidateDeclarations(true), |
| 87 | cel.EnableErrorOnBadPresenceTest(true), |
| 88 | cel.Types(&test2pb.TestAllTypes{}, &test2pb.Proto2ExtensionScopedMessage{}, &test3pb.TestAllTypes{}), |
| 89 | ext.Bindings(), |
| 90 | ext.Encoders(), |
| 91 | ext.Math(), |
| 92 | ext.Protos(), |
| 93 | ext.Strings(), |
| 94 | ext.TwoVarComprehensions(), |
| 95 | cel.Lib(celBlockLib{}), |
| 96 | cel.EnableIdentifierEscapeSyntax(), |
| 97 | } |
| 98 | |
| 99 | var err error |
| 100 | envNoMacros, err = cel.NewCustomEnv(stdOpts...) |
| 101 | if err != nil { |
| 102 | log.Fatalf("cel.NewCustomEnv() = %v", err) |
| 103 | } |
| 104 | envWithMacros, err = envNoMacros.Extend(cel.Macros(cel.StandardMacros...)) |
| 105 | if err != nil { |
| 106 | log.Fatalf("cel.NewCustomEnv() = %v", err) |
| 107 | } |
| 108 | } |
| 109 | |
| 110 | func TestMain(m *testing.M) { |
| 111 | flag.Parse() |
nothing calls this directly
no test coverage detected