[fine] Multi-module compilation
It's a little bit complicated, loading a module is a two-step dance but here's how it's done. Probably some surface-area refactoring needs to happen so that we do the right thing.
This commit is contained in:
parent
ab477cd783
commit
a3d4c24f11
8 changed files with 506 additions and 274 deletions
|
|
@ -107,7 +107,7 @@ fn generate_test_for_file(path: PathBuf) -> String {
|
|||
} else if let Some(line) = line.strip_prefix("@eval:") {
|
||||
let expected = line.trim();
|
||||
assertions.push(quote! {
|
||||
crate::assert_eval_ok(_module.clone(), #expected);
|
||||
crate::assert_eval_ok(&program, _module.clone(), #expected);
|
||||
});
|
||||
} else if let Some(line) = line.strip_prefix("@check-error:") {
|
||||
let expected = line.trim();
|
||||
|
|
@ -139,8 +139,8 @@ fn generate_test_for_file(path: PathBuf) -> String {
|
|||
#disabled
|
||||
fn #name() {
|
||||
let source : std::rc::Rc<str> = #contents.into();
|
||||
let mut runtime = crate::test_runtime(#display_path, source.clone());
|
||||
let (_errors, _module) = runtime.load_module("__test__").unwrap();
|
||||
let mut program = crate::test_runtime(#display_path, source.clone());
|
||||
let (_errors, _module) = program.load_module("__test__").unwrap();
|
||||
|
||||
#(#assertions)*
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue