summaryrefslogtreecommitdiff
path: root/tools/testrunner/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tools/testrunner/main.cpp')
-rw-r--r--tools/testrunner/main.cpp17
1 files changed, 6 insertions, 11 deletions
diff --git a/tools/testrunner/main.cpp b/tools/testrunner/main.cpp
index 4dafe508..3823215a 100644
--- a/tools/testrunner/main.cpp
+++ b/tools/testrunner/main.cpp
@@ -103,7 +103,8 @@ bool run_compiler(const ::helpers::path& source_file, const ::helpers::path& out
// Force optimised and debuggable
args.push_back("-O");
- args.push_back("-g");
+ // TODO: Only turn debug on when requested by the caller
+ //args.push_back("-g");
args.push_back("-L");
args.push_back("output");
@@ -386,14 +387,6 @@ int main(int argc, const char* argv[])
else
continue;
}
-
-#ifdef __linux__
- // Run `strip` on the test (if on linux)
- // XXX: Make this cleaner, or remove the need for it (by dynamic linking libstd)
- if( !run_executable("/usr/bin/strip", { "strip", outfile.str().c_str() }, "/dev/null") )
- {
- }
-#endif
}
else
{
@@ -520,9 +513,8 @@ bool run_executable(const ::helpers::path& exe_name, const ::std::vector<const c
STARTUPINFO si = { 0 };
si.cb = sizeof(si);
- si.dwFlags = STARTF_USESTDHANDLES;
+ si.dwFlags = STARTF_USESTDHANDLES|STARTF_FORCEOFFFEEDBACK;
si.hStdInput = NULL;
- si.hStdError = GetStdHandle(STD_ERROR_HANDLE);
{
SECURITY_ATTRIBUTES sa = { 0 };
sa.nLength = sizeof(sa);
@@ -532,8 +524,11 @@ bool run_executable(const ::helpers::path& exe_name, const ::std::vector<const c
//WriteFile(si.hStdOutput, cmdline_str.data(), static_cast<DWORD>(cmdline_str.size()), &tmp, NULL);
//WriteFile(si.hStdOutput, "\n", 1, &tmp, NULL);
}
+ DuplicateHandle(NULL, si.hStdOutput, NULL, &si.hStdError, GENERIC_WRITE, FALSE, FILE_SHARE_READ);
PROCESS_INFORMATION pi = { 0 };
+ auto em = SetErrorMode(SEM_NOGPFAULTERRORBOX);
CreateProcessA(exe_name.str().c_str(), (LPSTR)cmdline_str.c_str(), NULL, NULL, TRUE, 0, NULL, NULL, &si, &pi);
+ SetErrorMode(em);
CloseHandle(si.hStdOutput);
WaitForSingleObject(pi.hProcess, INFINITE);
DWORD status = 1;