Skip to content

Commit 17064f3

Browse files
committed
make mark_as_executed private
1 parent 868ef64 commit 17064f3

File tree

5 files changed

+8
-20
lines changed

5 files changed

+8
-20
lines changed

src/bootstrap/src/utils/exec.rs

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -211,15 +211,6 @@ impl<'a> BootstrapCommand {
211211
exec_ctx.as_ref().start(self, OutputMode::Capture, OutputMode::Print)
212212
}
213213

214-
/// Spawn the command in background, while capturing and returns a handle to stream the output.
215-
#[track_caller]
216-
pub fn stream_capture(
217-
&'a mut self,
218-
exec_ctx: impl AsRef<ExecutionContext>,
219-
) -> Option<StreamingCommand> {
220-
exec_ctx.as_ref().stream(self, OutputMode::Capture, OutputMode::Capture)
221-
}
222-
223214
/// Spawn the command in background, while capturing and returning stdout, and printing stderr.
224215
#[track_caller]
225216
pub fn stream_capture_stdout(
@@ -231,7 +222,7 @@ impl<'a> BootstrapCommand {
231222

232223
/// Mark the command as being executed, disarming the drop bomb.
233224
/// If this method is not called before the command is dropped, its drop will panic.
234-
pub fn mark_as_executed(&mut self) {
225+
fn mark_as_executed(&mut self) {
235226
self.drop_bomb.defuse();
236227
}
237228

@@ -654,7 +645,7 @@ impl ExecutionContext {
654645

655646
let stdout = child.stdout.take();
656647
let stderr = child.stderr.take();
657-
return Some(StreamingCommand { child, stdout, stderr });
648+
Some(StreamingCommand { child, stdout, stderr })
658649
}
659650
}
660651

src/bootstrap/src/utils/render_tests.rs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,6 @@ pub(crate) fn try_run_tests(
3434
cmd: &mut BootstrapCommand,
3535
stream: bool,
3636
) -> bool {
37-
if builder.config.dry_run() {
38-
cmd.mark_as_executed();
39-
return true;
40-
}
41-
4237
if !run_tests(builder, cmd, stream) {
4338
if builder.fail_fast {
4439
crate::exit!(1);
@@ -54,7 +49,9 @@ pub(crate) fn try_run_tests(
5449
fn run_tests(builder: &Builder<'_>, cmd: &mut BootstrapCommand, stream: bool) -> bool {
5550
builder.verbose(|| println!("running: {cmd:?}"));
5651

57-
let mut streaming_command = cmd.stream_capture_stdout(&builder.config.exec_ctx).unwrap();
52+
let Some(mut streaming_command) = cmd.stream_capture_stdout(&builder.config.exec_ctx) else {
53+
return true;
54+
};
5855

5956
// This runs until the stdout of the child is closed, which means the child exited. We don't
6057
// run this on another thread since the builder is not Sync.

src/etc/completions/x.fish

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,7 @@ complete -c x -n "__fish_x_using_subcommand doc" -l skip-std-check-if-no-downloa
293293
complete -c x -n "__fish_x_using_subcommand doc" -s h -l help -d 'Print help (see more with \'--help\')'
294294
complete -c x -n "__fish_x_using_subcommand test" -l test-args -d 'extra arguments to be passed for the test tool being used (e.g. libtest, compiletest or rustdoc)' -r
295295
complete -c x -n "__fish_x_using_subcommand test" -l compiletest-rustc-args -d 'extra options to pass the compiler when running compiletest tests' -r
296-
complete -c x -n "__fish_x_using_subcommand test" -l extra-checks -d 'comma-separated list of other files types to check (accepts py, py:lint, py:fmt, shell)' -r
296+
complete -c x -n "__fish_x_using_subcommand test" -l extra-checks -d 'comma-separated list of other files types to check (accepts py, py:lint, py:fmt, shell, shell:lint, cpp, cpp:fmt, spellcheck, spellcheck:fix)' -r
297297
complete -c x -n "__fish_x_using_subcommand test" -l compare-mode -d 'mode describing what file the actual ui output will be compared to' -r
298298
complete -c x -n "__fish_x_using_subcommand test" -l pass -d 'force {check,build,run}-pass tests to this mode' -r
299299
complete -c x -n "__fish_x_using_subcommand test" -l run -d 'whether to execute run-* tests' -r

src/etc/completions/x.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,7 @@ Register-ArgumentCompleter -Native -CommandName 'x' -ScriptBlock {
339339
'x;test' {
340340
[CompletionResult]::new('--test-args', '--test-args', [CompletionResultType]::ParameterName, 'extra arguments to be passed for the test tool being used (e.g. libtest, compiletest or rustdoc)')
341341
[CompletionResult]::new('--compiletest-rustc-args', '--compiletest-rustc-args', [CompletionResultType]::ParameterName, 'extra options to pass the compiler when running compiletest tests')
342-
[CompletionResult]::new('--extra-checks', '--extra-checks', [CompletionResultType]::ParameterName, 'comma-separated list of other files types to check (accepts py, py:lint, py:fmt, shell)')
342+
[CompletionResult]::new('--extra-checks', '--extra-checks', [CompletionResultType]::ParameterName, 'comma-separated list of other files types to check (accepts py, py:lint, py:fmt, shell, shell:lint, cpp, cpp:fmt, spellcheck, spellcheck:fix)')
343343
[CompletionResult]::new('--compare-mode', '--compare-mode', [CompletionResultType]::ParameterName, 'mode describing what file the actual ui output will be compared to')
344344
[CompletionResult]::new('--pass', '--pass', [CompletionResultType]::ParameterName, 'force {check,build,run}-pass tests to this mode')
345345
[CompletionResult]::new('--run', '--run', [CompletionResultType]::ParameterName, 'whether to execute run-* tests')

src/etc/completions/x.zsh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,7 @@ _arguments "${_arguments_options[@]}" : \
338338
_arguments "${_arguments_options[@]}" : \
339339
'*--test-args=[extra arguments to be passed for the test tool being used (e.g. libtest, compiletest or rustdoc)]:ARGS:_default' \
340340
'*--compiletest-rustc-args=[extra options to pass the compiler when running compiletest tests]:ARGS:_default' \
341-
'--extra-checks=[comma-separated list of other files types to check (accepts py, py\:lint, py\:fmt, shell)]:EXTRA_CHECKS:_default' \
341+
'--extra-checks=[comma-separated list of other files types to check (accepts py, py\:lint, py\:fmt, shell, shell\:lint, cpp, cpp\:fmt, spellcheck, spellcheck\:fix)]:EXTRA_CHECKS:_default' \
342342
'--compare-mode=[mode describing what file the actual ui output will be compared to]:COMPARE MODE:_default' \
343343
'--pass=[force {check,build,run}-pass tests to this mode]:check | build | run:_default' \
344344
'--run=[whether to execute run-* tests]:auto | always | never:_default' \

0 commit comments

Comments
 (0)