-
Notifications
You must be signed in to change notification settings - Fork 36
/
Copy pathsystem.rs
28 lines (25 loc) · 920 Bytes
/
system.rs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
use std::fs;
use std::path::Path;
use std::process::Command;
use test_finder::test_finder;
fn run_system_test(name: &Path) {
let output = Command::new("./target/debug/crush")
.args(&[name.to_str().unwrap()])
.output()
.expect("failed to execute process");
let output_name = name.with_extension("crush.output");
let expected_output = fs::read_to_string(output_name.to_str().unwrap())
.expect(format!("failed to read output file {}", output_name.to_str().unwrap()).as_str());
assert_eq!(
String::from_utf8_lossy(&output.stdout),
expected_output,
"\n\nError while running file {}",
name.to_str().unwrap()
);
}
#[test]
fn test_nothing() {
// This empty test only exists to make sure IDEs will realize that there are tests to run in
// this file. All the real tests are generated by the test_finder macro below.
}
test_finder!();