mirror of
https://github.com/danog/ir.git
synced 2024-11-26 12:24:56 +01:00
Hide Windows fault message box on Windows during make test
This commit is contained in:
parent
24f58e7759
commit
e88b6ab92d
@ -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) {
|
||||
|
@ -9,6 +9,10 @@
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#ifdef _WIN32
|
||||
# include <windows.h>
|
||||
#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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user