| 511 | } |
| 512 | |
| 513 | void RunCommandLineConversion(const BenchmarkConfig& config, |
| 514 | const std::string& input_path, |
| 515 | const std::string& output_path, |
| 516 | const std::string& measured_result_path) { |
| 517 | #ifdef OPENCC_BENCHMARK_JIEBA_CONFIG_DIR |
| 518 | if (IsJiebaConfig(config)) { |
| 519 | SetPluginSearchPath(OPENCC_BENCHMARK_JIEBA_PLUGIN_DIR); |
| 520 | } |
| 521 | #endif |
| 522 | |
| 523 | std::string command = QuotePath(OpenccBinaryPath()) + " -i " + |
| 524 | QuotePath(input_path) + " -o " + QuotePath(output_path) + |
| 525 | " -c " + QuotePath(config.path) + " --path " + |
| 526 | QuotePath(BuildDataDirectory()) + " --path " + |
| 527 | QuotePath(SourceConfigDirectory()) + |
| 528 | " --measured_result " + QuotePath(measured_result_path); |
| 529 | const int status = std::system(WrapSystemCommand(command).c_str()); |
| 530 | if (status != 0) { |
| 531 | throw Exception("opencc command failed with status " + |
| 532 | std::to_string(status)); |
| 533 | } |
| 534 | } |
| 535 | |
| 536 | SimpleConverter* Initialize(const BenchmarkConfig& config) { |
| 537 | chdir(PROJECT_BINARY_DIR "/data"); |
no test coverage detected