Skip to content

Commit 785309b

Browse files
author
Patrick Conrad
committed
Add make tests for preserving test binaries
fix: #88110
1 parent 4b45bb9 commit 785309b

File tree

2 files changed

+32
-0
lines changed

2 files changed

+32
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
include ../../run-make-fulldeps/tools.mk
2+
3+
# Check that valid binaries are persisted by running them, regardless of whether the --run or --no-run option is used.
4+
5+
all: run no_run
6+
7+
run:
8+
mkdir -p $(TMPDIR)/doctests
9+
$(RUSTC) --crate-type rlib t.rs
10+
$(RUSTDOC) -Zunstable-options --test --persist-doctests $(TMPDIR)/doctests --extern t=$(TMPDIR)/libt.rlib t.rs
11+
$(TMPDIR)/doctests/t_rs_2_0/rust_out
12+
$(TMPDIR)/doctests/t_rs_8_0/rust_out
13+
rm -rf $(TMPDIR)/doctests
14+
15+
no_run:
16+
mkdir -p $(TMPDIR)/doctests
17+
$(RUSTC) --crate-type rlib t.rs
18+
$(RUSTDOC) -Zunstable-options --test --persist-doctests $(TMPDIR)/doctests --extern t=$(TMPDIR)/libt.rlib t.rs --no-run
19+
$(TMPDIR)/doctests/t_rs_2_0/rust_out
20+
$(TMPDIR)/doctests/t_rs_8_0/rust_out
21+
rm -rf $(TMPDIR)/doctests
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
/// Fungle the foople.
2+
/// ```
3+
/// t::foople();
4+
/// ```
5+
pub fn foople() {}
6+
7+
/// Flomble the florp
8+
/// ```
9+
/// t::florp();
10+
/// ```
11+
pub fn florp() {}

0 commit comments

Comments
 (0)