Skip to content

Commit

Permalink
Fixing test cases and allowing multiple .expected files
Browse files Browse the repository at this point in the history
  • Loading branch information
JustusAdam committed Jun 28, 2023
1 parent c15a591 commit 7e08f3f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@ RESULTS:
Check 1: div.assertion.1
- Status: FAILURE
- Description: "attempt to divide by zero"
- Location: arbitrary_requires_fail.rs:6:5 in function div

Check 2: div.division-by-zero.1
- Status: SUCCESS
- Description: "division by zero"
- Location: arbitrary_requires_fail.rs:6:5 in function div
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@ RESULTS:
Check 1: div.assertion.1
- Status: SUCCESS
- Description: "attempt to divide by zero"
- Location: arbitrary_requires_pass.rs:6:5 in function div

Check 2: div.division-by-zero.1
- Status: SUCCESS
- Description: "division by zero"
- Location: arbitrary_requires_pass.rs:6:5 in function div
7 changes: 6 additions & 1 deletion tools/compiletest/src/runtest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,12 @@ impl<'test> TestCx<'test> {
/// the expected output in `expected` file.
fn run_expected_test(&self) {
let proc_res = self.run_kani();
let expected_path = self.testpaths.file.parent().unwrap().join("expected");
let dot_expected_path = self.testpaths.file.with_extension("expected");
let expected_path = if dot_expected_path.exists() {
dot_expected_path
} else {
self.testpaths.file.parent().unwrap().join("expected")
};
self.verify_output(&proc_res, &expected_path);
}

Expand Down

0 comments on commit 7e08f3f

Please sign in to comment.