Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Symbolic testing #887

Draft
wants to merge 10 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
235 changes: 227 additions & 8 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ members = ["crates/*"]
opt-level = 3

[profile.dev]
# Speeds up the build. May need to diable for debugging.
# Speeds up the build. May need to disable for debugging.
debug = 0
2 changes: 2 additions & 0 deletions crates/analyzer/src/db.rs
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,8 @@ pub trait AnalyzerDb: SourceDb + Upcast<dyn SourceDb> + UpcastMut<dyn SourceDb>
fn module_submodules(&self, module: ModuleId) -> Rc<[ModuleId]>;
#[salsa::invoke(queries::module::module_tests)]
fn module_tests(&self, module: ModuleId) -> Vec<FunctionId>;
#[salsa::invoke(queries::module::module_invariants)]
fn module_invariants(&self, module: ModuleId) -> Vec<FunctionId>;

// Module Constant
#[salsa::cycle(queries::module::module_constant_type_cycle)]
Expand Down
9 changes: 9 additions & 0 deletions crates/analyzer/src/db/queries/module.rs
Original file line number Diff line number Diff line change
Expand Up @@ -760,3 +760,12 @@ pub fn module_tests(db: &dyn AnalyzerDb, ingot: ModuleId) -> Vec<FunctionId> {
.filter(|function| function.is_test(db))
.collect()
}

pub fn module_invariants(db: &dyn AnalyzerDb, ingot: ModuleId) -> Vec<FunctionId> {
ingot
.all_functions(db)
.iter()
.copied()
.filter(|function| function.is_invariant(db))
.collect()
}
Loading