diff options
| author | Philipp A | 2019-11-12 22:57:02 +0100 | 
|---|---|---|
| committer | Philipp A | 2019-11-12 22:57:02 +0100 | 
| commit | 271cb95ec3e12d6f97852491bc723c5060ce4b75 (patch) | |
| tree | 78cb094fb882fd6c56733ff9e4d1a9377713d393 /build.rs | |
| parent | 18fba4a71eeebf3a2df91a6bcfda7f13e6c3f561 (diff) | |
| download | rust-rst-271cb95ec3e12d6f97852491bc723c5060ce4b75.tar.bz2 | |
Run python tests
Diffstat (limited to 'build.rs')
| -rw-r--r-- | build.rs | 22 | 
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()); +} | 
