Repository navigation
0.4.1: a standard stream kept while it is captured; what a program used - #20
Merged
Merged
Conversation
Co-authored-by: speak-agent <[email protected]>
Co-authored-by: speak-agent <[email protected]>
Co-authored-by: speak-agent <[email protected]>
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.
Implements mcpp-community/mcpp design 2026-11-09 (the target model PR): mcpp's unit tests move from GoogleTest to mtest, and nine of them read what mcpp prints on its standard error, which GoogleTest's
CaptureStderrgave them.Changes
stdio::capture.capture::begin(stream::error)(orstream::output) makes the stream a file untiltext()or destruction puts it back;text()gives what was written meanwhile — through openkal, the C library and the C++ streams, and by programs started meanwhile.openat/open,dup,dup2), asoutput_to_errordoes; Windows under the C runtime:_wopenand_dup2, which also sets the standard handle; Windows under openkal-musl: the C library's descriptor and the standard handle, each appending to the file; Emscripten: the C library's; an image:not_supported.process::resources.of::self: this program's user and system time, largest resident set, and bytes read and written (Linux/proc/self/io, WindowsGetProcessIoCounters);of::children: its waited-for children together, bygetrusage(Linux and macOS). Windows children and images answernot_supported. mtest's resource monitor (design 2026-11-09 §17.5) measures a program by starting it from a process of its own.tests/process_testcaptures the error stream of a copy of itself written through openkal, the C library and a started program, then checks that the stream was put back; a copy that touches 64 MiB is accounted to its parent.Verification
mcpp test processpasses (the new check holds).Co-authored-by: speak-agent [email protected]