diff --git a/ir-test.php b/ir-test.php index 2e60d30..1f40a39 100644 --- a/ir-test.php +++ b/ir-test.php @@ -50,14 +50,20 @@ function run_test($build_dir, $test, $name, $code, $expect, $args) { } else { $cmd = "$build_dir\\ir $input $args --no-abort-fault >$output 2>&1"; } - $ret = @system($cmd); + $ret = @system($cmd, $result_code); if ($ret === false) { return false; } + if ($result_code) { + } $out = @file_get_contents($output); if ($out === false) { return false; } + if ($result_code) { + $out = "\nExit Code = $result_code\n"; + file_put_contents($output, $out); + } $out = trim($out); $out = str_replace("\r", "", $out); if ($out !== $expect) { diff --git a/ir_main.c b/ir_main.c index 51494ab..57f5e71 100644 --- a/ir_main.c +++ b/ir_main.c @@ -9,6 +9,10 @@ #include #include +#ifdef _WIN32 +# include +#endif + static void help(const char *cmd) { printf( @@ -370,6 +374,7 @@ int main(int argc, char **argv) #ifdef _WIN32 if (!abort_fault) { _set_abort_behavior(0, _WRITE_ABORT_MSG|_CALL_REPORTFAULT); + SetErrorMode(SEM_FAILCRITICALERRORS|SEM_NOGPFAULTERRORBOX); } #endif