| 211 | } |
| 212 | |
| 213 | func testRunnerCompilerFromFlags(testCompilerOpts ...any) TestRunnerOption { |
| 214 | var opts []any |
| 215 | if fileDescriptorSetPath != "" { |
| 216 | opts = append(opts, compiler.TypeDescriptorSetFile(fileDescriptorSetPath)) |
| 217 | } |
| 218 | if baseConfigPath != "" { |
| 219 | opts = append(opts, compiler.EnvironmentFile(baseConfigPath)) |
| 220 | } |
| 221 | if configPath != "" { |
| 222 | opts = append(opts, compiler.EnvironmentFile(configPath)) |
| 223 | } |
| 224 | if enableCoverage { |
| 225 | opts = append(opts, cel.EnableMacroCallTracking()) |
| 226 | } |
| 227 | opts = append(opts, testCompilerOpts...) |
| 228 | return TestCompiler(opts...) |
| 229 | } |
| 230 | |
| 231 | // ActivationFactory is a function which creates a CEL activation from the provided variables. |
| 232 | type ActivationFactory func(vars any) (cel.Activation, error) |