Mercurial > python-compiler.rs
diff build.rs @ 94:e0368bea06a6
Refactor tests a little bit so it's easier to add more.
author | Bastien Orivel <eijebong@bananium.fr> |
---|---|
date | Tue, 14 Jun 2016 18:39:48 +0200 |
parents | 199ba034e4af |
children | 6569eea3db23 |
line wrap: on
line diff
--- a/build.rs +++ b/build.rs @@ -3,8 +3,7 @@ use std::path::Path; use std::io::prelude::*; use std::fs::{File, read_dir}; -fn main() { - let out_dir = env::var("OUT_DIR").unwrap(); +fn gen_parse_file_tests(out_dir: String) { let path = Path::new(&out_dir).join("generated_parse_tests.rs"); let mut f = File::create(&path).unwrap(); @@ -17,3 +16,8 @@ fn {}() {{ }}\n", test_name, path.to_str().unwrap()).as_bytes()).unwrap(); } } + +fn main() { + let out_dir = env::var("OUT_DIR").unwrap(); + gen_parse_file_tests(out_dir); +}