| 102 | } |
| 103 | |
| 104 | void read_code(const std::string& code_path, std::string& code) { |
| 105 | auto& fs = fma_common::FileSystem::GetFileSystem(code_path); |
| 106 | if (fs.FileExists(code_path)) { |
| 107 | fma_common::InputFmaStream ifs(code_path, 0); |
| 108 | size_t sz = ifs.Size(); |
| 109 | code.resize(sz); |
| 110 | size_t ssz = ifs.Read(&code[0], sz); |
| 111 | if (ssz != sz) { |
| 112 | UT_ERR() << "Failed to read plugin file " << code_path; |
| 113 | } |
| 114 | } else { |
| 115 | UT_ERR() << "Failed to find plugin file " << code_path; |
| 116 | } |
| 117 | } |
| 118 | |
| 119 | TEST_F(TestCppPlugin, CppPlugin) { |
| 120 | using namespace fma_common; |
no test coverage detected