@@ -1573,6 +1573,7 @@ forgetest!(gas_report_all_contracts, |prj, cmd| {
1573
1573
1574
1574
// report for all
1575
1575
prj. write_config( Config {
1576
+ optimizer: true ,
1576
1577
gas_reports: ( vec![ "*" . to_string( ) ] ) ,
1577
1578
gas_reports_ignore: ( vec![ ] ) ,
1578
1579
..Default :: default ( )
@@ -1682,7 +1683,7 @@ Ran 3 test suites [ELAPSED]: 3 tests passed, 0 failed, 0 skipped (3 total tests)
1682
1683
. is_json( ) ,
1683
1684
) ;
1684
1685
1685
- prj. write_config( Config { gas_reports: ( vec![ ] ) , ..Default :: default ( ) } ) ;
1686
+ prj. write_config( Config { optimizer : true , gas_reports: ( vec![ ] ) , ..Default :: default ( ) } ) ;
1686
1687
cmd. forge_fuse( ) . arg( "test" ) . arg( "--gas-report" ) . assert_success( ) . stdout_eq( str ![ [ r#"
1687
1688
...
1688
1689
╭----------------------------------------+-----------------+-------+--------+-------+---------╮
@@ -1787,7 +1788,11 @@ Ran 3 test suites [ELAPSED]: 3 tests passed, 0 failed, 0 skipped (3 total tests)
1787
1788
. is_json( ) ,
1788
1789
) ;
1789
1790
1790
- prj. write_config( Config { gas_reports: ( vec![ "*" . to_string( ) ] ) , ..Default :: default ( ) } ) ;
1791
+ prj. write_config( Config {
1792
+ optimizer: true ,
1793
+ gas_reports: ( vec![ "*" . to_string( ) ] ) ,
1794
+ ..Default :: default ( )
1795
+ } ) ;
1791
1796
cmd. forge_fuse( ) . arg( "test" ) . arg( "--gas-report" ) . assert_success( ) . stdout_eq( str ![ [ r#"
1792
1797
...
1793
1798
╭----------------------------------------+-----------------+-------+--------+-------+---------╮
@@ -1893,6 +1898,7 @@ Ran 3 test suites [ELAPSED]: 3 tests passed, 0 failed, 0 skipped (3 total tests)
1893
1898
) ;
1894
1899
1895
1900
prj. write_config( Config {
1901
+ optimizer: true ,
1896
1902
gas_reports: ( vec![
1897
1903
"ContractOne" . to_string( ) ,
1898
1904
"ContractTwo" . to_string( ) ,
@@ -2010,7 +2016,11 @@ forgetest!(gas_report_some_contracts, |prj, cmd| {
2010
2016
prj. add_source( "Contracts.sol" , GAS_REPORT_CONTRACTS ) . unwrap( ) ;
2011
2017
2012
2018
// report for One
2013
- prj. write_config( Config { gas_reports: vec![ "ContractOne" . to_string( ) ] , ..Default :: default ( ) } ) ;
2019
+ prj. write_config( Config {
2020
+ optimizer: true ,
2021
+ gas_reports: vec![ "ContractOne" . to_string( ) ] ,
2022
+ ..Default :: default ( )
2023
+ } ) ;
2014
2024
cmd. forge_fuse( ) ;
2015
2025
cmd. arg( "test" ) . arg( "--gas-report" ) . assert_success( ) . stdout_eq( str ![ [ r#"
2016
2026
...
@@ -2057,7 +2067,11 @@ Ran 3 test suites [ELAPSED]: 3 tests passed, 0 failed, 0 skipped (3 total tests)
2057
2067
) ;
2058
2068
2059
2069
// report for Two
2060
- prj. write_config( Config { gas_reports: vec![ "ContractTwo" . to_string( ) ] , ..Default :: default ( ) } ) ;
2070
+ prj. write_config( Config {
2071
+ optimizer: true ,
2072
+ gas_reports: vec![ "ContractTwo" . to_string( ) ] ,
2073
+ ..Default :: default ( )
2074
+ } ) ;
2061
2075
cmd. forge_fuse( ) ;
2062
2076
cmd. arg( "test" ) . arg( "--gas-report" ) . assert_success( ) . stdout_eq( str ![ [ r#"
2063
2077
...
@@ -2105,6 +2119,7 @@ Ran 3 test suites [ELAPSED]: 3 tests passed, 0 failed, 0 skipped (3 total tests)
2105
2119
2106
2120
// report for Three
2107
2121
prj. write_config( Config {
2122
+ optimizer: true ,
2108
2123
gas_reports: vec![ "ContractThree" . to_string( ) ] ,
2109
2124
..Default :: default ( )
2110
2125
} ) ;
@@ -2160,6 +2175,7 @@ forgetest!(gas_report_ignore_some_contracts, |prj, cmd| {
2160
2175
2161
2176
// ignore ContractOne
2162
2177
prj. write_config( Config {
2178
+ optimizer: true ,
2163
2179
gas_reports: ( vec![ "*" . to_string( ) ] ) ,
2164
2180
gas_reports_ignore: ( vec![ "ContractOne" . to_string( ) ] ) ,
2165
2181
..Default :: default ( )
@@ -2242,6 +2258,7 @@ Ran 3 test suites [ELAPSED]: 3 tests passed, 0 failed, 0 skipped (3 total tests)
2242
2258
// ignore ContractTwo
2243
2259
cmd. forge_fuse( ) ;
2244
2260
prj. write_config( Config {
2261
+ optimizer: true ,
2245
2262
gas_reports: ( vec![ ] ) ,
2246
2263
gas_reports_ignore: ( vec![ "ContractTwo" . to_string( ) ] ) ,
2247
2264
..Default :: default ( )
@@ -2328,6 +2345,7 @@ Ran 3 test suites [ELAPSED]: 3 tests passed, 0 failed, 0 skipped (3 total tests)
2328
2345
// indicating the "double listing".
2329
2346
cmd. forge_fuse( ) ;
2330
2347
prj. write_config( Config {
2348
+ optimizer: true ,
2331
2349
gas_reports: ( vec![
2332
2350
"ContractOne" . to_string( ) ,
2333
2351
"ContractTwo" . to_string( ) ,
@@ -2461,6 +2479,7 @@ Warning: ContractThree is listed in both 'gas_reports' and 'gas_reports_ignore'.
2461
2479
} ) ;
2462
2480
2463
2481
forgetest ! ( gas_report_flatten_multiple_selectors, |prj, cmd| {
2482
+ prj. write_config( Config { optimizer: true , ..Default :: default ( ) } ) ;
2464
2483
prj. insert_ds_test( ) ;
2465
2484
prj. add_source(
2466
2485
"Counter.sol" ,
@@ -2579,6 +2598,7 @@ Ran 1 test suite [ELAPSED]: 1 tests passed, 0 failed, 0 skipped (1 total tests)
2579
2598
2580
2599
// <https://github.com/foundry-rs/foundry/issues/9115>
2581
2600
forgetest_init ! ( gas_report_with_fallback, |prj, cmd| {
2601
+ prj. write_config( Config { optimizer: true , ..Default :: default ( ) } ) ;
2582
2602
prj. add_test(
2583
2603
"DelegateProxyTest.sol" ,
2584
2604
r#"
@@ -2722,6 +2742,7 @@ Ran 1 test suite [ELAPSED]: 1 tests passed, 0 failed, 0 skipped (1 total tests)
2722
2742
2723
2743
// <https://github.com/foundry-rs/foundry/issues/9300>
2724
2744
forgetest_init ! ( gas_report_size_for_nested_create, |prj, cmd| {
2745
+ prj. write_config( Config { optimizer: true , ..Default :: default ( ) } ) ;
2725
2746
prj. add_test(
2726
2747
"NestedDeployTest.sol" ,
2727
2748
r#"
@@ -3160,6 +3181,7 @@ Error: No source files found in specified build paths.
3160
3181
3161
3182
// checks that build --sizes includes all contracts even if unchanged
3162
3183
forgetest_init ! ( can_build_sizes_repeatedly, |prj, cmd| {
3184
+ prj. write_config( Config { optimizer: true , ..Default :: default ( ) } ) ;
3163
3185
prj. clear_cache( ) ;
3164
3186
3165
3187
cmd. args( [ "build" , "--sizes" ] ) . assert_success( ) . stdout_eq( str ![ [ r#"
@@ -3226,6 +3248,7 @@ interface Counter {
3226
3248
// checks that `clean` also works with the "out" value set in Config
3227
3249
forgetest_init ! ( gas_report_include_tests, |prj, cmd| {
3228
3250
prj. write_config( Config {
3251
+ optimizer: true ,
3229
3252
gas_reports_include_tests: true ,
3230
3253
fuzz: FuzzConfig { runs: 1 , ..Default :: default ( ) } ,
3231
3254
..Default :: default ( )
0 commit comments