| 95 | } |
| 96 | |
| 97 | void PrintFile(const char* name, std::ostream& os) |
| 98 | { |
| 99 | const char* div = "======================================================================="; |
| 100 | // Preserve valuable output regardless of the limits set in |
| 101 | // CMake/CTestCustom.cmake |
| 102 | os << "CTEST_FULL_OUTPUT\n"; |
| 103 | os << "File \"" << name << "\""; |
| 104 | vtksys::SystemTools::Stat_t fs; |
| 105 | if (vtksys::SystemTools::Stat(name, &fs) != 0) |
| 106 | { |
| 107 | os << " does not exist.\n"; |
| 108 | return; |
| 109 | } |
| 110 | else |
| 111 | { |
| 112 | os << " has " << fs.st_size << " bytes"; |
| 113 | } |
| 114 | |
| 115 | vtksys::ifstream fin(name); |
| 116 | if (fin) |
| 117 | { |
| 118 | os << ":\n" << div << "\n"; |
| 119 | os << fin.rdbuf(); |
| 120 | os << div << "\n"; |
| 121 | os.flush(); |
| 122 | } |
| 123 | else |
| 124 | { |
| 125 | os << " but cannot be opened for read.\n"; |
| 126 | } |
| 127 | } |
| 128 | |
| 129 | bool CompareAsciiFiles(const char* file1, const char* file2) |
| 130 | { |
no test coverage detected