diff options
author | John Hodge <tpg@ucc.asn.au> | 2018-10-06 18:14:13 +0800 |
---|---|---|
committer | John Hodge <tpg@ucc.asn.au> | 2018-10-06 18:14:13 +0800 |
commit | 1382500b5fdba00568a86f0122bc2e78584dfb5d (patch) | |
tree | fc293328eea89d6639c4a36f268f5a1e1c826d6e /tools/testrunner/main.cpp | |
parent | 4a8198baca2cfcee17f83978ab71422a04d53b1a (diff) | |
parent | bd3d69813cc54439fdc0db33943fa1254db3df06 (diff) | |
download | mrust-1382500b5fdba00568a86f0122bc2e78584dfb5d.tar.gz |
Merge branch 'master' of https://github.com/thepowersgang/mrustc
Diffstat (limited to 'tools/testrunner/main.cpp')
-rw-r--r-- | tools/testrunner/main.cpp | 17 |
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; |