Skip to content

Commit

Permalink
tests: profile compute units in success cases
Browse files Browse the repository at this point in the history
  • Loading branch information
buffalojoec committed Oct 11, 2024
1 parent 4748ed8 commit 9ff7775
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 0 deletions.
4 changes: 4 additions & 0 deletions program/tests/deploy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,7 @@ fn success() {
],
&[
Check::success(),
Check::compute_units(1_052),
Check::account(&program).data(&check_data).build(),
],
);
Expand Down Expand Up @@ -285,6 +286,7 @@ fn success() {
],
&[
Check::success(),
Check::compute_units(1_052),
Check::account(&program).data(&check_data).build(),
],
);
Expand Down Expand Up @@ -566,6 +568,7 @@ fn success_source_program() {
],
&[
Check::success(),
Check::compute_units(2_122),
Check::account(&program).data(&check_data).build(),
Check::account(&source).data(&[]).build(),
],
Expand Down Expand Up @@ -607,6 +610,7 @@ fn success_source_program() {
],
&[
Check::success(),
Check::compute_units(2_049),
Check::account(&program).data(&check_data).build(),
Check::account(&source).data(&[]).build(),
],
Expand Down
1 change: 1 addition & 0 deletions program/tests/finalize.rs
Original file line number Diff line number Diff line change
Expand Up @@ -432,6 +432,7 @@ fn success() {
],
&[
Check::success(),
Check::compute_units(963),
Check::account(&program).data(&check_data).build(),
],
);
Expand Down
1 change: 1 addition & 0 deletions program/tests/retract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,7 @@ fn success() {
],
&[
Check::success(),
Check::compute_units(1_007),
Check::account(&program).data(&check_data).build(),
],
);
Expand Down
1 change: 1 addition & 0 deletions program/tests/transfer_authority.rs
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,7 @@ fn success() {
],
&[
Check::success(),
Check::compute_units(1_032),
Check::account(&program).data(&check_data).build(),
],
);
Expand Down
3 changes: 3 additions & 0 deletions program/tests/truncate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@ fn success_initialization() {
],
&[
Check::success(),
Check::compute_units(1_113),
Check::account(&program).data(&check_data).build(),
],
);
Expand Down Expand Up @@ -462,6 +463,7 @@ fn success() {
],
&[
Check::success(),
Check::compute_units(1_205),
Check::account(&program).data(&check_data).build(),
],
);
Expand Down Expand Up @@ -494,6 +496,7 @@ fn success() {
],
&[
Check::success(),
Check::compute_units(1_450),
Check::account(&program).data(&check_data).build(),
Check::account(&destination)
.lamports(expected_destination_lamports)
Expand Down
2 changes: 2 additions & 0 deletions program/tests/write.rs
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,7 @@ fn success() {
],
&[
Check::success(),
Check::compute_units(868),
Check::account(&program).data(&check_data).build(),
],
);
Expand All @@ -247,6 +248,7 @@ fn success() {
],
&[
Check::success(),
Check::compute_units(840),
Check::account(&program).data(&check_data).build(),
],
);
Expand Down

0 comments on commit 9ff7775

Please sign in to comment.