From ce264306b8c3e0c9bf652c9843625d4b76f6207c Mon Sep 17 00:00:00 2001 From: Brendan Chandler Date: Fri, 5 Feb 2021 15:10:22 -0600 Subject: [PATCH] Fix merge issues with src/tools/makeTestfile.pl When I switched from merge to rebase of RTEMS5 changes, I think this file didn't get merge correctly. These changes bring the file back to match what was originally merged, and I believe correct. --- src/tools/makeTestfile.pl | 58 ++++++++++++++++++++++++++++----------- 1 file changed, 42 insertions(+), 16 deletions(-) diff --git a/src/tools/makeTestfile.pl b/src/tools/makeTestfile.pl index 183454485..686e3c1a3 100644 --- a/src/tools/makeTestfile.pl +++ b/src/tools/makeTestfile.pl @@ -6,7 +6,7 @@ # Operator of Los Alamos National Laboratory. # SPDX-License-Identifier: EPICS # EPICS BASE is distributed subject to a Software License Agreement found -# in file LICENSE that is included with this distribution. +# in file LICENSE that is included with this distribution. #************************************************************************* # The makeTestfile.pl script generates a file $target.t which is needed @@ -41,11 +41,11 @@ elsif ($TA =~ /^windows-x64/ && $HA !~ /^win/) { elsif ($TA =~ /^RTEMS-pc[36]86-qemu$/) { # Run the pc386 and pc686 test harness w/ QEMU $exec = "qemu-system-i386 -m 64 -no-reboot " - . "-serial stdio -display none " - . "-net nic,model=rtl8139 -net nic,model=ne2k_pci " - . "-net user,restrict=yes " - . "-append --console=/dev/com1 " - . "-kernel $exe"; + . "-serial stdio -display none " + . "-net nic,model=rtl8139 -net nic,model=ne2k_pci " + . "-net user,restrict=yes " + . "-append --console=/dev/com1 " + . "-kernel $exe"; $error = "qemu-system-i386 ... -kernel $exe"; } elsif ($TA =~ /^RTEMS-/) { @@ -57,26 +57,52 @@ else { $error = $exec = "./$exe"; } -# Run the test program with system on Windows, exec elsewhere. -# This is required by the Perl test harness. -my $runtest = ($^O eq 'MSWin32') ? - "system('$exec') == 0" : "exec '$exec'"; +# Ensure that Windows interactive error handling is disabled. +# This setting is inherited by the test process. +# Set SEM_FAILCRITICALERRORS (1) Disable critical-error-handler dialog +# Clear SEM_NOGPFAULTERRORBOX (2) Enabled WER to allow automatic post mortem debugging (AeDebug) +# Clear SEM_NOALIGNMENTFAULTEXCEPT (4) Allow alignment fixups +# Set SEM_NOOPENFILEERRORBOX (0x8000) Prevent dialog on some I/O errors +# https://docs.microsoft.com/en-us/windows/win32/api/errhandlingapi/nf-errhandlingapi-seterrormode?redirectedfrom=MSDN +my $sem = $^O ne 'MSWin32' ? '' : <import(\$sem); + }; + eval { + require Win32API::File; + Win32API::File->import(\$sem); + } if \$@; + SetErrorMode(0x8001) unless \$@; +} +ENDBEGIN open my $OUT, '>', $target or die "Can't create $target: $!\n"; -print $OUT <<__EOF__; +print $OUT <> 8; +} +else { + exec '$exec' or die "Can't run $exec: \$!\\n"; +} +EOF -close $OUT + close $OUT or die "Can't close $target: $!\n";