From c87ae947ebdc868825f9ba23f45ec1a4878be996 Mon Sep 17 00:00:00 2001 From: Guillaume Gomez <guillaume.gomez@huawei.com> Date: Wed, 15 May 2024 11:46:04 +0200 Subject: [PATCH] Add new `htmldocck` function to `run-make-support` --- src/tools/run-make-support/src/lib.rs | 6 ++++++ .../run-make/rustdoc-scrape-examples-ordering/rmake.rs | 10 ++-------- 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(); }