Merge pull request #26 from stkeke/show_diff_win

[ir-test]: Fix #25: use 'fc.exe' for diff on Windows
This commit is contained in:
Dmitry Stogov 2023-04-25 09:22:57 +03:00 committed by GitHub
commit 20d3a4fac1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -24,13 +24,15 @@
# define PATH_SEP "\\"
# define EXE_SUF ".exe"
# define REGEX_FLAGS std::regex::extended
# define DIFF_ARGS "--strip-trailing-cr"
# define DIFF_CMD "fc.exe"
# define DIFF_ARGS "/n"
# define IR_ARGS "--no-abort-fault"
#else
# define PATH_SEP "/"
# define EXE_SUF ""
# define REGEX_FLAGS std::regex::ECMAScript | std::regex::multiline
# define DIFF_ARGS ""
# define DIFF_CMD "diff"
# define DIFF_ARGS "--strip-trailing-cr -u"
# define IR_ARGS ""
#endif
@ -182,7 +184,7 @@ namespace ir {
in_os.close();
auto test_cmd = ::ir_exe + " " + ir_file + " " + args + " " + IR_ARGS + " >" + out_file + " 2>&1";
auto diff_cmd = std::string("diff") + " " + DIFF_ARGS + " -u " + exp_file + " " + out_file + " > " + diff_file + " 2>&1";
auto diff_cmd = std::string(DIFF_CMD) + " " + DIFF_ARGS + " " + exp_file + " " + out_file + " > " + diff_file + " 2>&1";
int ret_code = std::system(test_cmd.c_str()) >> 0x8;