Skip to content

Commit fe260f0

Browse files
committed
WIP
1 parent 701768b commit fe260f0

File tree

5 files changed

+68
-20
lines changed

5 files changed

+68
-20
lines changed

build.rs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
use std::process::Command;
2+
3+
fn main() {
4+
let sysroot = Command::new("rustc")
5+
.arg("--print")
6+
.arg("sysroot")
7+
.output()
8+
.expect("Failed to get sysroot")
9+
.stdout;
10+
11+
let sysroot_path = String::from_utf8(sysroot).expect("Invalid UTF-8").trim().to_string();
12+
13+
println!("cargo:rustc-link-arg=-Wl,-rpath,{}/lib", sysroot_path);
14+
}

run_tests.sh

Lines changed: 0 additions & 16 deletions
This file was deleted.

src/borrows/borrows_visitor.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ use crate::{
1616
visit::Visitor, AggregateKind, BorrowKind, Const, Location, Operand, Rvalue,
1717
Statement, StatementKind, Terminator, TerminatorKind,
1818
},
19-
ty::{self, Region, RegionKind, RegionVid, TypeVisitable, TypeVisitor},
19+
ty::{self, TypeVisitable, TypeVisitor},
2020
},
2121
},
2222
utils::Place,
@@ -38,7 +38,7 @@ use super::{
3838
path_condition::PathConditions,
3939
region_projection::{PCGRegion, RegionProjection},
4040
region_projection_member::RegionProjectionMember,
41-
unblock_graph::{UnblockGraph, UnblockType},
41+
unblock_graph::UnblockGraph,
4242
};
4343
use super::{
4444
domain::{AbstractionOutputTarget, AbstractionType, FunctionCallAbstraction},

src/main.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,9 @@ fn mir_borrowck<'tcx>(tcx: TyCtxt<'tcx>, def_id: LocalDefId) -> MirBorrowck<'tcx
4545

4646
fn should_check_body(body: &BodyWithBorrowckFacts<'_>) -> bool {
4747
// DEBUG
48-
body.body.basic_blocks.len() < 8
48+
// body.body.basic_blocks.len() < 8
4949

50-
// true
50+
true
5151
}
5252

5353
fn run_pcs_on_all_fns<'tcx>(tcx: TyCtxt<'tcx>) {

tests/run_all_tests.rs

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
#[test]
2+
fn run_all_tests() {
3+
use std::process::Command;
4+
5+
// Get the current executable's directory
6+
let current_exe = std::env::current_exe().unwrap();
7+
let target_dir = current_exe.parent().unwrap().parent().unwrap();
8+
let workspace_dir = target_dir.parent().unwrap();
9+
10+
// Find all numbered test files
11+
let test_dir = workspace_dir.join("tests");
12+
let mut test_files: Vec<_> = std::fs::read_dir(&test_dir)
13+
.unwrap()
14+
.filter_map(|entry| {
15+
let entry = entry.unwrap();
16+
let path = entry.path();
17+
let file_name = path.file_name()?.to_str()?;
18+
// Match files that start with numbers and end with .rs
19+
// Exclude .wip files
20+
if file_name.chars().next()?.is_ascii_digit() && file_name.ends_with(".rs") {
21+
Some(path)
22+
} else {
23+
None
24+
}
25+
})
26+
.collect();
27+
28+
// Sort test files by name to ensure consistent order
29+
test_files.sort();
30+
31+
// Get the path to our executable
32+
let pcs_exe = target_dir.join("pcs_bin");
33+
34+
// Run each test file
35+
for test_file in test_files {
36+
println!("Running test: {}", test_file.display());
37+
38+
let status = Command::new(&pcs_exe)
39+
.arg(&test_file)
40+
.status()
41+
.unwrap_or_else(|e| panic!("Failed to execute test {}: {}", test_file.display(), e));
42+
43+
assert!(
44+
status.success(),
45+
"Test {} failed with status: {}",
46+
test_file.display(),
47+
status
48+
);
49+
}
50+
}

0 commit comments

Comments
 (0)