Skip to content

Commit

Permalink
add test_output dir
Browse files Browse the repository at this point in the history
  • Loading branch information
martinjrobins committed Nov 2, 2023
1 parent 1c5abd9 commit 86cf87d
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 9 deletions.
8 changes: 4 additions & 4 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@
"filter": {
"name": "diffeq",
"kind": "lib"
}
},
},
"args": [],
"cwd": "${workspaceFolder}"
"cwd": "${workspaceFolder}",
},
{
"type": "lldb",
Expand Down Expand Up @@ -55,10 +55,10 @@
"filter": {
"name": "diffeq",
"kind": "bin"
}
},
},
"args": [],
"cwd": "${workspaceFolder}"
"cwd": "${workspaceFolder}",
}
]
}
6 changes: 3 additions & 3 deletions src/codegen/compiler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -553,7 +553,7 @@ mod tests {
let model_info = ModelInfo::build("logistic_growth", &models).unwrap();
assert_eq!(model_info.errors.len(), 0);
let discrete_model = DiscreteModel::from(&model_info);
let object = Compiler::from_discrete_model(&discrete_model, "compiler_test_object_file").unwrap();
let object = Compiler::from_discrete_model(&discrete_model, "test_output/compiler_test_object_file").unwrap();
let path = Path::new("main.o");
object.write_object_file(path).unwrap();
}
Expand Down Expand Up @@ -591,7 +591,7 @@ mod tests {
panic!("{}", e.as_error_message(full_text.as_str()));
}
};
let compiler = Compiler::from_discrete_model(&discrete_model, "tensor_test_$name").unwrap();
let compiler = Compiler::from_discrete_model(&discrete_model, concat!("test_output/compiler_tensor_test_", stringify!($name))).unwrap();
let inputs = vec![];
let mut u0 = vec![1.];
let mut up0 = vec![1.];
Expand Down Expand Up @@ -660,7 +660,7 @@ mod tests {
";
let model = parse_ds_string(full_text).unwrap();
let discrete_model = DiscreteModel::build("$name", &model).unwrap();
let compiler = Compiler::from_discrete_model(&discrete_model, "compiler_test_additional_functions").unwrap();
let compiler = Compiler::from_discrete_model(&discrete_model, "test_output/compiler_test_additional_functions").unwrap();
let (n_states, n_inputs, n_outputs, n_data, n_indices) = compiler.get_dims();
assert_eq!(n_states, 2);
assert_eq!(n_inputs, 1);
Expand Down
4 changes: 2 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ mod tests {
let text = std::fs::read_to_string(format!("examples/{}.ds", example)).unwrap();
let model = parse_ds_string(text.as_str()).unwrap();
let model = DiscreteModel::build(example, &model).unwrap_or_else(|e| panic!("{}", e.as_error_message(text.as_str())));
let out = format!("lib_examples_{}", example);
let out = format!("test_output/lib_examples_{}", example);
Compiler::from_discrete_model(&model, out.as_str()).unwrap()
}

Expand Down Expand Up @@ -228,7 +228,7 @@ mod tests {
let model_info = ModelInfo::build("logistic_growth", &models).unwrap();
assert_eq!(model_info.errors.len(), 0);
let discrete_model = DiscreteModel::from(&model_info);
let object = Compiler::from_discrete_model(&discrete_model, "lib_test_object_file").unwrap();
let object = Compiler::from_discrete_model(&discrete_model, "test_output/lib_test_object_file").unwrap();
let path = Path::new("main.o");
object.write_object_file(path).unwrap();
}
Expand Down
2 changes: 2 additions & 0 deletions test_output/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
*
!.gitignore

0 comments on commit 86cf87d

Please sign in to comment.