Runs WriteCCOps and stores output in (internal_)cc_file_path and (internal_)h_file_path.
| 84 | // Runs WriteCCOps and stores output in (internal_)cc_file_path and |
| 85 | // (internal_)h_file_path. |
| 86 | void GenerateCcOpFiles(Env* env, const OpList& ops, |
| 87 | const ApiDefMap& api_def_map, string* h_file_text, |
| 88 | string* internal_h_file_text) { |
| 89 | const string& tmpdir = testing::TmpDir(); |
| 90 | |
| 91 | const auto h_file_path = io::JoinPath(tmpdir, "test.h"); |
| 92 | const auto cc_file_path = io::JoinPath(tmpdir, "test.cc"); |
| 93 | const auto internal_h_file_path = io::JoinPath(tmpdir, "test_internal.h"); |
| 94 | const auto internal_cc_file_path = io::JoinPath(tmpdir, "test_internal.cc"); |
| 95 | |
| 96 | WriteCCOps(ops, api_def_map, h_file_path, cc_file_path); |
| 97 | |
| 98 | TF_ASSERT_OK(ReadFileToString(env, h_file_path, h_file_text)); |
| 99 | TF_ASSERT_OK( |
| 100 | ReadFileToString(env, internal_h_file_path, internal_h_file_text)); |
| 101 | } |
| 102 | |
| 103 | TEST(CcOpGenTest, TestVisibilityChangedToHidden) { |
| 104 | const string api_def = R"( |
no test coverage detected