Skip to content

Commit 7025a96

Browse files
committed
tests: profile compute units in success cases
1 parent 4748ed8 commit 7025a96

File tree

6 files changed

+12
-0
lines changed

6 files changed

+12
-0
lines changed

program/tests/deploy.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,7 @@ fn success() {
253253
],
254254
&[
255255
Check::success(),
256+
Check::compute_units(1_058),
256257
Check::account(&program).data(&check_data).build(),
257258
],
258259
);
@@ -285,6 +286,7 @@ fn success() {
285286
],
286287
&[
287288
Check::success(),
289+
Check::compute_units(1_058),
288290
Check::account(&program).data(&check_data).build(),
289291
],
290292
);
@@ -566,6 +568,7 @@ fn success_source_program() {
566568
],
567569
&[
568570
Check::success(),
571+
Check::compute_units(2_122),
569572
Check::account(&program).data(&check_data).build(),
570573
Check::account(&source).data(&[]).build(),
571574
],
@@ -607,6 +610,7 @@ fn success_source_program() {
607610
],
608611
&[
609612
Check::success(),
613+
Check::compute_units(2_049),
610614
Check::account(&program).data(&check_data).build(),
611615
Check::account(&source).data(&[]).build(),
612616
],

program/tests/finalize.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -432,6 +432,7 @@ fn success() {
432432
],
433433
&[
434434
Check::success(),
435+
Check::compute_units(967),
435436
Check::account(&program).data(&check_data).build(),
436437
],
437438
);

program/tests/retract.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -254,6 +254,7 @@ fn success() {
254254
],
255255
&[
256256
Check::success(),
257+
Check::compute_units(1_011),
257258
Check::account(&program).data(&check_data).build(),
258259
],
259260
);

program/tests/transfer_authority.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -272,6 +272,7 @@ fn success() {
272272
],
273273
&[
274274
Check::success(),
275+
Check::compute_units(1_036),
275276
Check::account(&program).data(&check_data).build(),
276277
],
277278
);

program/tests/truncate.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,7 @@ fn success_initialization() {
172172
],
173173
&[
174174
Check::success(),
175+
Check::compute_units(1_122),
175176
Check::account(&program).data(&check_data).build(),
176177
],
177178
);
@@ -462,6 +463,7 @@ fn success() {
462463
],
463464
&[
464465
Check::success(),
466+
Check::compute_units(1_218),
465467
Check::account(&program).data(&check_data).build(),
466468
],
467469
);
@@ -494,6 +496,7 @@ fn success() {
494496
],
495497
&[
496498
Check::success(),
499+
Check::compute_units(1_466),
497500
Check::account(&program).data(&check_data).build(),
498501
Check::account(&destination)
499502
.lamports(expected_destination_lamports)

program/tests/write.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,7 @@ fn success() {
230230
],
231231
&[
232232
Check::success(),
233+
Check::compute_units(1_039),
233234
Check::account(&program).data(&check_data).build(),
234235
],
235236
);
@@ -247,6 +248,7 @@ fn success() {
247248
],
248249
&[
249250
Check::success(),
251+
Check::compute_units(1_193),
250252
Check::account(&program).data(&check_data).build(),
251253
],
252254
);

0 commit comments

Comments
 (0)