Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a command line flag to avoid printing to stdout and stderr #2084

Merged
merged 6 commits into from
May 10, 2022
Merged

Conversation

oli-obk
Copy link
Contributor

@oli-obk oli-obk commented Apr 25, 2022

This is practical for tests that don't actually care about the output and thus don't want it intermingled with miri's warnings, errors or ICEs

fixes #2083

@saethlin
Copy link
Member

Does this add a command line flag? Or just another MIRIFLAGS?

src/shims/posix/fs.rs Outdated Show resolved Hide resolved
src/bin/miri.rs Outdated Show resolved Hide resolved
@RalfJung
Copy link
Member

Does this add a command line flag? Or just another MIRIFLAGS?

Those are the same thing? MIRIFLAGS is how you pass command line flags to the Miri driver when using the cargo wrapper.

@saethlin
Copy link
Member

Ah. I have only ever used the Cargo wrapper, this whole "Miri driver" thing is just something I hear you mention 😅

README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
@RalfJung
Copy link
Member

r=me with the last 2 nits fixed. :)

@oli-obk
Copy link
Contributor Author

oli-obk commented May 10, 2022

@bors r=RalfJung

@bors
Copy link
Collaborator

bors commented May 10, 2022

📌 Commit 6dc6256 has been approved by RalfJung

@bors
Copy link
Collaborator

bors commented May 10, 2022

⌛ Testing commit 6dc6256 with merge 36c274a...

@bors
Copy link
Collaborator

bors commented May 10, 2022

☀️ Test successful - checks-actions
Approved by: RalfJung
Pushing 36c274a to master...

Comment on lines 259 to 315
impl<'tcx> Default for FileHandler {
fn default() -> Self {
impl<'tcx> FileHandler {
pub(crate) fn new(drop_stdout_stderr: bool) -> FileHandler {
let mut handles: BTreeMap<_, Box<dyn FileDescriptor>> = BTreeMap::new();
handles.insert(0i32, Box::new(io::stdin()));
handles.insert(1i32, Box::new(io::stdout()));
if drop_stdout_stderr {
handles.insert(0i32, Box::new(DevNull));
handles.insert(1i32, Box::new(DevNull));
} else {
handles.insert(0i32, Box::new(io::stdin()));
handles.insert(1i32, Box::new(io::stdout()));
}
handles.insert(2i32, Box::new(io::stderr()));
FileHandler { handles }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cc #2143

@oli-obk perhaps the problem is that here, you touched stdout and STDIN but the handling of STDERR (line 264/314) actually remains unchanged? 😅

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Aaaaa dammit

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

option to silence cargo miri run executable output
5 participants