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

[minor] Add a new allowed attribute for skipping mutation testing #14942

Merged
merged 3 commits into from
Oct 12, 2024
Merged
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
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
processed 2 tasks
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
//# init --addresses Alice=0xf75daa73fc071f93593335eb9033da804777eb94491650dd3f095ce6f778acb6
//# --private-keys Alice=56a26140eb233750cd14fb168c3eb4bd0782b099cde626ec8aff7f3cceb6364f

//# publish --private-key Alice
module Alice::allowed_attributes {
#[mutation::skip]
fun blah() {}

#[fmt::skip]
#[mutation::skip]
fun blah_blah() {}
}
4 changes: 3 additions & 1 deletion aptos-move/framework/src/extended_checks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ const INIT_MODULE_FUN: &str = "init_module";
const LEGACY_ENTRY_FUN_ATTRIBUTE: &str = "legacy_entry_fun";
const ERROR_PREFIX: &str = "E";
const EVENT_STRUCT_ATTRIBUTE: &str = "event";
const MUTATION_SKIP_ATTRIBUTE: &str = "mutation::skip";
const RANDOMNESS_ATTRIBUTE: &str = "randomness";
const RANDOMNESS_MAX_GAS_CLAIM: &str = "max_gas";
const RESOURCE_GROUP: &str = "resource_group";
Expand All @@ -52,10 +53,11 @@ const RANDOMNESS_MODULE_NAME: &str = "randomness";

// top-level attribute names, only.
pub fn get_all_attribute_names() -> &'static BTreeSet<String> {
const ALL_ATTRIBUTE_NAMES: [&str; 8] = [
const ALL_ATTRIBUTE_NAMES: [&str; 9] = [
ALLOW_UNSAFE_RANDOMNESS_ATTRIBUTE,
FMT_SKIP_ATTRIBUTE,
LEGACY_ENTRY_FUN_ATTRIBUTE,
MUTATION_SKIP_ATTRIBUTE,
RESOURCE_GROUP,
RESOURCE_GROUP_MEMBER,
VIEW_FUN_ATTRIBUTE,
Expand Down
Loading