Skip to content

Commit 293f7da

Browse files
committed
add detection for doctests
1 parent 4e16502 commit 293f7da

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/subcommand/runner.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,13 @@ pub(crate) fn runner(args: RunnerArgs) -> Result<i32, ErrorMessage> {
99
.executable
1010
.parent()
1111
.ok_or("kernel executable has no parent")?;
12-
let is_test = exe_parent.ends_with("deps");
12+
let is_doctest = exe_parent
13+
.file_name()
14+
.ok_or("kernel executable's parent has no file name")?
15+
.to_str()
16+
.ok_or("kernel executable's parent file name is not valid UTF-8")?
17+
.starts_with("rustdoctest");
18+
let is_test = is_doctest || exe_parent.ends_with("deps");
1319

1420
let bootimage_bin = {
1521
let file_stem = args

0 commit comments

Comments
 (0)