aboutsummaryrefslogtreecommitdiffstats
path: root/build.rs
diff options
context:
space:
mode:
authorPhilipp A2019-11-12 22:57:02 +0100
committerPhilipp A2019-11-12 22:57:02 +0100
commit271cb95ec3e12d6f97852491bc723c5060ce4b75 (patch)
tree78cb094fb882fd6c56733ff9e4d1a9377713d393 /build.rs
parent18fba4a71eeebf3a2df91a6bcfda7f13e6c3f561 (diff)
downloadrust-rst-271cb95ec3e12d6f97852491bc723c5060ce4b75.tar.bz2
Run python tests
Diffstat (limited to 'build.rs')
-rw-r--r--build.rs22
1 files changed, 22 insertions, 0 deletions
diff --git a/build.rs b/build.rs
new file mode 100644
index 0000000..88b6214
--- /dev/null
+++ b/build.rs
@@ -0,0 +1,22 @@
+
+use std::env;
+use std::io::{self, Write};
+use std::path::Path;
+use std::process::Command;
+
+fn main() {
+ let manifest_dir = env::var("CARGO_MANIFEST_DIR").unwrap();
+
+ let input = Path::new(&manifest_dir).join("build_tests.py");
+ let output = Path::new(&env::var("OUT_DIR").unwrap()).join("html_tests.rs");
+ println!("cargo:rerun-if-changed={}", input.display());
+
+ let output = Command::new("python3")
+ .arg("build_tests.py")
+ .arg(format!("{}", output.display()))
+ .output()
+ .expect("failed to execute process");
+ io::stdout().write_all(&output.stdout).unwrap();
+ io::stderr().write_all(&output.stderr).unwrap();
+ assert!(output.status.success());
+}