| 29 | namespace xla { |
| 30 | |
| 31 | StatusOr<bool> RunFileCheck(const std::string& input, |
| 32 | absl::string_view pattern) { |
| 33 | // Generate an input file for the FileCheck pattern. |
| 34 | std::string pattern_path; |
| 35 | auto env = tensorflow::Env::Default(); |
| 36 | if (!env->LocalTempFilename(&pattern_path)) { |
| 37 | return tensorflow::errors::Internal("couldn't get a pattern file name"); |
| 38 | } |
| 39 | TF_RETURN_IF_ERROR(tensorflow::WriteStringToFile(env, pattern_path, pattern)); |
| 40 | |
| 41 | return RunFileCheckWithPatternFile(input, pattern_path); |
| 42 | } |
| 43 | |
| 44 | StatusOr<bool> RunFileCheckWithPatternFile(const std::string& input, |
| 45 | const std::string& pattern_file) { |
no test coverage detected