| 191 | #include <boost/test/included/prg_exec_monitor.hpp> |
| 192 | |
| 193 | int cpp_main(int argc, char* argv[]) // note name! |
| 194 | { |
| 195 | if (argc != 5) |
| 196 | { |
| 197 | std::cerr << "Usage: path_table \"POSIX\"|\"Windows\" input-file posix-file output-file\n" |
| 198 | "Run on POSIX first, then on Windows\n" |
| 199 | " \"POSIX\" causes POSIX results to be saved in posix-file;\n" |
| 200 | " \"Windows\" causes POSIX results read from posix-file\n" |
| 201 | " input-file contains the paths to appear in the table.\n" |
| 202 | " posix-file will be used for POSIX results\n" |
| 203 | " output-file will contain the generated HTML.\n"; |
| 204 | return 1; |
| 205 | } |
| 206 | |
| 207 | infile.open(argv[2]); |
| 208 | if (!infile) |
| 209 | { |
| 210 | std::cerr << "Could not open input file: " << argv[2] << std::endl; |
| 211 | return 1; |
| 212 | } |
| 213 | |
| 214 | if (string(argv[1]) == "POSIX") |
| 215 | { |
| 216 | posix = true; |
| 217 | posix_outfile.open(argv[3]); |
| 218 | if (!posix_outfile) |
| 219 | { |
| 220 | std::cerr << "Could not open POSIX output file: " << argv[3] << std::endl; |
| 221 | return 1; |
| 222 | } |
| 223 | } |
| 224 | else |
| 225 | { |
| 226 | posix = false; |
| 227 | posix_infile.open(argv[3]); |
| 228 | if (!posix_infile) |
| 229 | { |
| 230 | std::cerr << "Could not open POSIX input file: " << argv[3] << std::endl; |
| 231 | return 1; |
| 232 | } |
| 233 | } |
| 234 | |
| 235 | outfile.open(argv[4]); |
| 236 | if (!outfile) |
| 237 | { |
| 238 | std::cerr << "Could not open output file: " << argv[2] << std::endl; |
| 239 | return 1; |
| 240 | } |
| 241 | |
| 242 | outfile << "<html>\n" |
| 243 | "<head>\n" |
| 244 | "<title>Path Decomposition Table</title>\n" |
| 245 | "</head>\n" |
| 246 | "<body bgcolor=\"#ffffff\" text=\"#000000\">\n"; |
| 247 | |
| 248 | do_table(); |
| 249 | |
| 250 | outfile << "</body>\n" |