Skip to content

Commit

Permalink
Add make tests for preserving test binaries
Browse files Browse the repository at this point in the history
  • Loading branch information
Patrick Conrad committed Aug 25, 2021
1 parent 4b45bb9 commit 785309b
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
21 changes: 21 additions & 0 deletions src/test/run-make/doctests-keep-binaries/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
include ../../run-make-fulldeps/tools.mk

# Check that valid binaries are persisted by running them, regardless of whether the --run or --no-run option is used.

all: run no_run

run:
mkdir -p $(TMPDIR)/doctests
$(RUSTC) --crate-type rlib t.rs
$(RUSTDOC) -Zunstable-options --test --persist-doctests $(TMPDIR)/doctests --extern t=$(TMPDIR)/libt.rlib t.rs
$(TMPDIR)/doctests/t_rs_2_0/rust_out
$(TMPDIR)/doctests/t_rs_8_0/rust_out
rm -rf $(TMPDIR)/doctests

no_run:
mkdir -p $(TMPDIR)/doctests
$(RUSTC) --crate-type rlib t.rs
$(RUSTDOC) -Zunstable-options --test --persist-doctests $(TMPDIR)/doctests --extern t=$(TMPDIR)/libt.rlib t.rs --no-run
$(TMPDIR)/doctests/t_rs_2_0/rust_out
$(TMPDIR)/doctests/t_rs_8_0/rust_out
rm -rf $(TMPDIR)/doctests
11 changes: 11 additions & 0 deletions src/test/run-make/doctests-keep-binaries/t.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/// Fungle the foople.
/// ```
/// t::foople();
/// ```
pub fn foople() {}

/// Flomble the florp
/// ```
/// t::florp();
/// ```
pub fn florp() {}

0 comments on commit 785309b

Please sign in to comment.