Skip to content

Commit

Permalink
Add test to verify that APIs used by tests are attributed correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
davidlattimore committed Sep 19, 2023
1 parent cb15164 commit d2e384e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
4 changes: 4 additions & 0 deletions test_crates/cackle.toml
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,10 @@ allow_apis = [

[pkg.crab-11.test]
sandbox.kind = "Disabled"
allow_apis = [
"env",
"terminate",
]

[pkg.crab-1.build.sandbox]
allow_network = true
5 changes: 5 additions & 0 deletions test_crates/crab-11/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,10 @@ mod tests {
#[test]
fn it_works() {
access_file();

// Verify that APIs used from the test itself are attributed as we expect.
if std::env::var("CACKLE_TEST_TERMINATE_1").is_ok() {
std::process::abort();
}
}
}

0 comments on commit d2e384e

Please sign in to comment.