Commit d5049e3c authored by Jeff Smits's avatar Jeff Smits

Failing 30 tests, but at least they run now!

parent e01a5252
......@@ -293,20 +293,26 @@ fn gen_strc_tests() {
#[test]
fn {}() {{
let str_path = io::find_str_path(None);
let f = ATermFactory::new();
let libraries = iter::once(String::from("libstratego-lib"))
.map(|lib_path| io::read_lib(&f, str_path.as_ref(), &lib_path))
.collect::<Result<_>>();
assert!(libraries.is_ok());
let libraries = libraries.unwrap();
let program = io::read_aterm(&f, &"{}");
assert!(program.is_ok());
let program = program.unwrap();
let term = interpret_main(&f, program, libraries);
assert!(term.is_ok());
let term = term.unwrap();
let mut result = String::new();
assert!(term.to_ascii(&mut result).is_ok());
let handler = thread::Builder::new()
.name("Main execution thread".into())
.stack_size(STACK_SIZE * 1024 * 1024)
.spawn(move || {{
let f = ATermFactory::new();
let libraries = iter::once(String::from("libstratego-lib"))
.map(|lib_path| io::read_lib(&f, str_path.as_ref(), &lib_path))
.collect::<Result<_>>();
assert!(libraries.is_ok());
let program = io::read_aterm(&f, &"{}");
assert!(program.is_ok());
let term = interpret_main(&f, program.unwrap(), libraries.unwrap());
assert!(term.is_ok());
let mut result = String::new();
assert!(term.unwrap().to_ascii(&mut result).is_ok());
result
}});
assert!(handler.is_ok());
let result = handler.unwrap().join();
assert!(result.is_ok());
}}
"#,
test_name,
......
......@@ -9,5 +9,8 @@ use strs::interpreter::interpret_main;
use aterm::print::ATermWrite;
use std::iter;
use std::thread;
const STACK_SIZE: usize = 32;
include!(concat!(env!("OUT_DIR"), "/strc_tests.rs"));
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment