Fix test execution error handling with stderr output#10
Closed
Conversation
Temporarily set $ErrorActionPreference to "Continue" around the test suite execution. With the global "Stop" preference, any stderr output from the native executable (e.g. Boost.Test banner/progress text) was being wrapped as a PowerShell ErrorRecord and immediately triggering a terminating NativeCommandError — even when the test suite passes. The exit code is already checked explicitly via $LASTEXITCODE, so relaxing the preference for this one invocation is safe. https://claude.ai/code/session_013jwxdTatbs5LJz3QyiDmjy
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Modified the test execution logic in the build script to prevent native executable stderr output from triggering PowerShell errors when
ErrorActionPreferenceis set toStop.Key Changes
ErrorActionPreferencetoContinueduring test executionErrorActionPreferencevalue to maintain script behaviorNativeCommandErrorImplementation Details
The issue occurred because when
ErrorActionPreference=Stopis active, PowerShell treats stderr output from native commands as errors when combined with2>&1redirection. By temporarily settingErrorActionPreferencetoContinueduring test execution, stderr output is captured as regular output without triggering an exception. The original preference is restored immediately after test execution completes.https://claude.ai/code/session_013jwxdTatbs5LJz3QyiDmjy