mirror of
https://github.com/dnlbauer/WHAM.git
synced 2026-09-10 22:25:31 +00:00
faster tests
This commit is contained in:
@@ -14,7 +14,7 @@ mod integration {
|
||||
let output_file = "/tmp/wham_test_1d_cyclic.out";
|
||||
get_command()
|
||||
.args(&["--bins", "100", "--max", "pi", "--min", "-pi", "-T", "300", "--cyclic"])
|
||||
.args(&["--bt", "100", "--seed", "1234"])
|
||||
.args(&["--seed", "1234"])
|
||||
.args(&["-f", "example/1d_cyclic/metadata.dat"])
|
||||
.args(&["-o", output_file])
|
||||
.output()
|
||||
@@ -60,9 +60,9 @@ mod integration {
|
||||
let output_file = "/tmp/wham_test_convdt.out";
|
||||
get_command()
|
||||
.args(&["--bins", "10", "--max", "pi", "--min", "-pi", "-T", "300", "--cyclic"])
|
||||
.args(&["--seed", "1234"])
|
||||
.args(&["--start", "0", "--end", "100"])
|
||||
.args(&["--convdt", "10"])
|
||||
.args(&["--seed", "1234", "--tolerance", "0.001"])
|
||||
.args(&["--start", "0", "--end", "10"])
|
||||
.args(&["--convdt", "1"])
|
||||
.args(&["-f", "example/1d_cyclic/metadata.dat"])
|
||||
.args(&["-o", output_file])
|
||||
.output()
|
||||
@@ -70,11 +70,11 @@ mod integration {
|
||||
assert!(fs::metadata(output_file).is_ok());
|
||||
|
||||
// run wham for individual sets
|
||||
for i in (10..110).step_by(10) {
|
||||
for i in 1..11 {
|
||||
let output_file_single = format!("/tmp/wham_test_convdt_{}.out", i);
|
||||
get_command()
|
||||
.args(&["--bins", "10", "--max", "pi", "--min", "-pi", "-T", "300", "--cyclic"])
|
||||
.args(&["--seed", "1234"])
|
||||
.args(&["--seed", "1234", "--tolerance", "0.001"])
|
||||
.args(&["--start", "0", "--end", &i.to_string()])
|
||||
.args(&["-f", "example/1d_cyclic/metadata.dat"])
|
||||
.args(&["-o", &output_file_single])
|
||||
@@ -91,7 +91,7 @@ mod integration {
|
||||
.open(output_combined)
|
||||
.unwrap();
|
||||
for i in 1..11 {
|
||||
let output_file_single = format!("/tmp/wham_test_convdt_{}.out", i*10);
|
||||
let output_file_single = format!("/tmp/wham_test_convdt_{}.out", i);
|
||||
println!("{}", output_file_single);
|
||||
file.write_all(format!("#Dataset {}\n", i-1).as_bytes()).unwrap();
|
||||
file.write_all(fs::read_to_string(output_file_single.clone()).unwrap().as_bytes()).unwrap();
|
||||
@@ -112,6 +112,29 @@ mod integration {
|
||||
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[ignore]
|
||||
fn wham_1d_cyclic_bootstrap() {
|
||||
let output_file = "/tmp/wham_test_1d_cyclic_bt.out";
|
||||
get_command()
|
||||
.args(&["--bins", "100", "--max", "pi", "--min", "-pi", "-T", "300", "--cyclic"])
|
||||
.args(&["--seed", "1234", "--bt", "100"])
|
||||
.args(&["-f", "example/1d_cyclic/metadata.dat"])
|
||||
.args(&["-o", output_file])
|
||||
.output()
|
||||
.expect("failed to execute process");
|
||||
|
||||
assert!(fs::metadata(output_file).is_ok());
|
||||
let output = Command::new("diff")
|
||||
.arg(output_file)
|
||||
.arg("example/1d_cyclic/wham_bt.out")
|
||||
.output()
|
||||
.expect("failed to run diff");
|
||||
let output_len = String::from_utf8_lossy(&output.stdout).len();
|
||||
assert_eq!(output_len, 0);
|
||||
std::fs::remove_file(output_file).unwrap();
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[ignore] // expensive
|
||||
fn wham_2d_cyclic() {
|
||||
|
||||
Reference in New Issue
Block a user