about summary refs log tree commit diff
diff options
context:
space:
mode:
authorGuillaume Gomez <guillaume.gomez@huawei.com>2024-05-15 11:46:04 +0200
committerGuillaume Gomez <guillaume.gomez@huawei.com>2024-05-15 11:46:04 +0200
commitc87ae947ebdc868825f9ba23f45ec1a4878be996 (patch)
tree253845037c4b317f11d0d6a09aa1c28412088961
parentac385a5af6d9fa8399a0cec799833cd28324abf8 (diff)
downloadrust-c87ae947ebdc868825f9ba23f45ec1a4878be996.tar.gz
rust-c87ae947ebdc868825f9ba23f45ec1a4878be996.zip
Add new `htmldocck` function to `run-make-support`
-rw-r--r--src/tools/run-make-support/src/lib.rs6
-rw-r--r--tests/run-make/rustdoc-scrape-examples-ordering/rmake.rs10
2 files changed, 8 insertions, 8 deletions
diff --git a/src/tools/run-make-support/src/lib.rs b/src/tools/run-make-support/src/lib.rs
index cc81d23a8ff..5295388d02c 100644
--- a/src/tools/run-make-support/src/lib.rs
+++ b/src/tools/run-make-support/src/lib.rs
@@ -59,6 +59,12 @@ pub fn python_command() -> Command {
     Command::new(python_path)
 }
 
+pub fn htmldocck() -> Command {
+    let mut python = python_command();
+    python.arg(source_path().join("/src/etc/htmldocck.py"));
+    python
+}
+
 pub fn source_path() -> PathBuf {
     std::env::var("S").expect("S variable does not exist").into()
 }
diff --git a/tests/run-make/rustdoc-scrape-examples-ordering/rmake.rs b/tests/run-make/rustdoc-scrape-examples-ordering/rmake.rs
index edcf3406d47..08ca9ce5de8 100644
--- a/tests/run-make/rustdoc-scrape-examples-ordering/rmake.rs
+++ b/tests/run-make/rustdoc-scrape-examples-ordering/rmake.rs
@@ -1,4 +1,4 @@
-use run_make_support::{python_command, rustc, rustdoc, source_path, tmp_dir};
+use run_make_support::{htmldocck, rustc, rustdoc, source_path, tmp_dir};
 use std::fs::read_dir;
 use std::path::Path;
 
@@ -45,11 +45,5 @@ fn main() {
     }
     rustdoc.run();
 
-    python_command()
-        .arg(source_path().join("/src/etc/htmldocck.py"))
-        .arg(out_dir)
-        .arg("src/lib.rs")
-        .status()
-        .unwrap()
-        .success();
+    htmldocck().arg(out_dir).arg("src/lib.rs").status().unwrap().success();
 }