| 73 | } |
| 74 | |
| 75 | func updateRunfilesPathForFlags(testResourcesDir string) error { |
| 76 | if testResourcesDir == "" { |
| 77 | return nil |
| 78 | } |
| 79 | paths := make([]*string, 0, 5) |
| 80 | if compiler.InferFileFormat(testSuitePath) != compiler.Unspecified { |
| 81 | paths = append(paths, &testSuitePath) |
| 82 | } |
| 83 | if compiler.InferFileFormat(fileDescriptorSetPath) != compiler.Unspecified { |
| 84 | paths = append(paths, &fileDescriptorSetPath) |
| 85 | } |
| 86 | if compiler.InferFileFormat(configPath) != compiler.Unspecified { |
| 87 | paths = append(paths, &configPath) |
| 88 | } |
| 89 | if compiler.InferFileFormat(baseConfigPath) != compiler.Unspecified { |
| 90 | paths = append(paths, &baseConfigPath) |
| 91 | } |
| 92 | if compiler.InferFileFormat(celExpression) != compiler.Unspecified { |
| 93 | paths = append(paths, &celExpression) |
| 94 | } |
| 95 | return UpdateTestResourcesPaths(testResourcesDir, paths) |
| 96 | } |
| 97 | |
| 98 | // UpdateTestResourcesPaths updates the list of paths with their absolute paths as per their location |
| 99 | // in the testResourcesDir directory. This will allow the executable targets to locate and access the |