File tree 1 file changed +5
-3
lines changed
1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -113,6 +113,7 @@ impl DocTestRunner {
113
113
mod __doctest_mod {{
114
114
use std::sync::OnceLock;
115
115
use std::path::PathBuf;
116
+ use std::process::ExitCode;
116
117
117
118
pub static BINARY_PATH: OnceLock<PathBuf> = OnceLock::new();
118
119
pub const RUN_OPTION: &str = \" RUSTDOC_DOCTEST_RUN_NB_TEST\" ;
@@ -123,16 +124,17 @@ mod __doctest_mod {{
123
124
}}
124
125
125
126
#[allow(unused)]
126
- pub fn doctest_runner(bin: &std::path::Path, test_nb: usize) -> Result<(), String> {{
127
+ pub fn doctest_runner(bin: &std::path::Path, test_nb: usize) -> ExitCode {{
127
128
let out = std::process::Command::new(bin)
128
129
.env(self::RUN_OPTION, test_nb.to_string())
129
130
.args(std::env::args().skip(1).collect::<Vec<_>>())
130
131
.output()
131
132
.expect(\" failed to run command\" );
132
133
if !out.status.success() {{
133
- Err(String::from_utf8_lossy(&out.stderr).to_string())
134
+ eprintln!(\" {{}}\" , String::from_utf8_lossy(&out.stderr));
135
+ ExitCode::FAILURE
134
136
}} else {{
135
- Ok(())
137
+ ExitCode::SUCCESS
136
138
}}
137
139
}}
138
140
}}
You can’t perform that action at this time.
0 commit comments