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

Move TestContext to a scoped variable #18486

Merged
merged 2 commits into from
May 17, 2022
Merged

Conversation

kghost
Copy link
Contributor

@kghost kghost commented May 16, 2022

Problem

Because multiple test files are linked together to generate final test binary, even if a test is not runned, the global variable TestContext sContext is still linked and initialized, which may be distractive while debugging test cases, because lots of objects are initialized but not used.

Change overview

Move TestContext sContext to a scoped variable

Testing

Passed unit-tests

@github-actions
Copy link

github-actions bot commented May 16, 2022

PR #18486: Size comparison from bf909a5 to 47d7dfb

Full report (37 builds for cc13x2_26x2, cyw30739, efr32, esp32, k32w, linux, mbed, nrfconnect, p6, telink)
platform target config section bf909a5 47d7dfb change % change
cc13x2_26x2 all-clusters-app LP_CC2652R7 (read only) 689259 689259 0 0.0
(read/write) 162300 162300 0 0.0
.bss 74540 74540 0 0.0
.data 3412 3412 0 0.0
.rodata 103091 103091 0 0.0
.text 585688 585688 0 0.0
lock-ftd LP_CC2652R7 (read only) 676603 676603 0 0.0
(read/write) 166044 166044 0 0.0
.bss 72684 72684 0 0.0
.data 3236 3236 0 0.0
.rodata 94811 94811 0 0.0
.text 581308 581308 0 0.0
lock-mtd LP_CC2652R7 (read only) 625419 625419 0 0.0
(read/write) 145516 145516 0 0.0
.bss 68420 68420 0 0.0
.data 3236 3236 0 0.0
.rodata 94691 94691 0 0.0
.text 530236 530236 0 0.0
pump-app LP_CC2652R7 (read only) 660175 660175 0 0.0
(read/write) 183760 183760 0 0.0
.bss 72948 72948 0 0.0
.data 3268 3268 0 0.0
.rodata 80351 80351 0 0.0
.text 579344 579344 0 0.0
pump-controller-app LP_CC2652R7 (read only) 653347 653347 0 0.0
(read/write) 190388 190388 0 0.0
.bss 73004 73004 0 0.0
.data 3232 3232 0 0.0
.rodata 83451 83451 0 0.0
.text 569416 569416 0 0.0
shell LP_CC2652R7 (read only) 683614 683614 0 0.0
(read/write) 163768 163768 0 0.0
.bss 77164 77164 0 0.0
.data 3416 3416 0 0.0
.rodata 100638 100638 0 0.0
.text 582492 582492 0 0.0
cyw30739 light cyw930739m2evb_01 (read/write) 624498 624498 0 0.0
.app_xip_area 528112 528112 0 0.0
.bss 79028 79028 0 0.0
.data 708 708 0 0.0
.rodata 0 0 0 0.0
.text 0 0 0 0.0
lock cyw930739m2evb_01 (read/write) 627558 627558 0 0.0
.app_xip_area 532628 532628 0 0.0
.bss 77604 77604 0 0.0
.data 672 672 0 0.0
.rodata 0 0 0 0.0
.text 0 0 0 0.0
ota-requestor-no-progress-logging cyw930739m2evb_01 (read/write) 572202 572202 0 0.0
.app_xip_area 467556 467556 0 0.0
.bss 87024 87024 0 0.0
.data 584 584 0 0.0
.rodata 0 0 0 0.0
.text 112 112 0 0.0
efr32 lighting-app BRD4161A (read only) 914812 914812 0 0.0
(read/write) 133236 133236 0 0.0
.bss 131176 131176 0 0.0
.data 2060 2060 0 0.0
.text 914804 914804 0 0.0
BRD4161A+rpc (read only) 948984 948984 0 0.0
(read/write) 149920 149920 0 0.0
.bss 147656 147656 0 0.0
.data 2264 2264 0 0.0
.text 948976 948976 0 0.0
BRD4161A+rs911x (read only) 784144 784144 0 0.0
(read/write) 128460 128460 0 0.0
.bss 126388 126388 0 0.0
.data 2068 2068 0 0.0
.text 784136 784136 0 0.0
lock-app BRD4161A+wf200 (read only) 944940 944940 0 0.0
(read/write) 122940 122940 0 0.0
.bss 120916 120916 0 0.0
.data 2024 2024 0 0.0
.text 944932 944932 0 0.0
window-app BRD4161A (read only) 894932 894932 0 0.0
(read/write) 133296 133296 0 0.0
.bss 131248 131248 0 0.0
.data 2048 2048 0 0.0
.text 894924 894924 0 0.0
esp32 all-clusters-app c3devkit (read only) 996624 996624 0 0.0
(read/write) 1476314 1476314 0 0.0
.dram0.bss 67152 67152 0 0.0
.dram0.data 14568 14568 0 0.0
.flash.rodata 209160 209160 0 0.0
.flash.text 996624 996624 0 0.0
.iram0.text 62954 62954 0 0.0
m5stack (read only) 1052103 1052103 0 0.0
(read/write) 478344 478344 0 0.0
.dram0.bss 72672 72672 0 0.0
.dram0.data 34184 34184 0 0.0
.flash.rodata 239492 239492 0 0.0
.flash.text 1046719 1046719 0 0.0
.iram0.text 123267 123267 0 0.0
k32w light k32w061+release (read/write) 682388 682388 0 0.0
.bss 80216 80216 0 0.0
.data 2016 2016 0 0.0
.text 598452 598452 0 0.0
lock k32w061+release (read/write) 728760 728760 0 0.0
.bss 80648 80648 0 0.0
.data 1976 1976 0 0.0
.text 644432 644432 0 0.0
linux all-clusters-app debug (read only) 2732673 2732673 0 0.0
(read/write) 174456 174456 0 0.0
.bss 83808 83808 0 0.0
.data 2064 2064 0 0.0
.data.rel.ro 82456 82456 0 0.0
.dynamic 608 608 0 0.0
.got 4488 4488 0 0.0
.init 27 27 0 0.0
.init_array 1008 1008 0 0.0
.rodata 237949 237949 0 0.0
.text 2318850 2318850 0 0.0
bridge-app debug+rpc (read only) 2020873 2020873 0 0.0
(read/write) 146424 146424 0 0.0
.bss 71616 71616 0 0.0
.data 3936 3936 0 0.0
.data.rel.ro 65288 65288 0 0.0
.dynamic 592 592 0 0.0
.got 4272 4272 0 0.0
.init 27 27 0 0.0
.init_array 688 688 0 0.0
.rodata 167337 167337 0 0.0
.text 1695554 1695554 0 0.0
chip-tool debug (read only) 9267573 9267573 0 0.0
(read/write) 577936 577936 0 0.0
.bss 22816 22816 0 0.0
.data 1136 1136 0 0.0
.data.rel.ro 547680 547680 0 0.0
.dynamic 624 624 0 0.0
.got 5000 5000 0 0.0
.init 27 27 0 0.0
.init_array 648 648 0 0.0
.rodata 478485 478485 0 0.0
.text 7462469 7462469 0 0.0
chip-tool-no-interactive-ipv6only arm64 (read only) 9044388 9044388 0 0.0
(read/write) 644065 644065 0 0.0
.bss 41105 41105 0 0.0
.data 1192 1192 0 0.0
.data.rel.ro 582936 582936 0 0.0
.dynamic 560 560 0 0.0
.got 14984 14984 0 0.0
.init 24 24 0 0.0
.init_array 184 184 0 0.0
.rodata 444564 444564 0 0.0
.text 7138116 7138116 0 0.0
lighting-app debug+rpc (read only) 2314697 2314697 0 0.0
(read/write) 151904 151904 0 0.0
.bss 73440 73440 0 0.0
.data 2048 2048 0 0.0
.data.rel.ro 70664 70664 0 0.0
.dynamic 608 608 0 0.0
.got 4344 4344 0 0.0
.init 27 27 0 0.0
.init_array 792 792 0 0.0
.rodata 186409 186409 0 0.0
.text 1961074 1961074 0 0.0
lock-app debug (read only) 2228441 2228441 0 0.0
(read/write) 146552 146552 0 0.0
.bss 72096 72096 0 0.0
.data 1568 1568 0 0.0
.data.rel.ro 67192 67192 0 0.0
.dynamic 592 592 0 0.0
.got 4336 4336 0 0.0
.init 27 27 0 0.0
.init_array 752 752 0 0.0
.rodata 196985 196985 0 0.0
.text 1870562 1870562 0 0.0
ota-provider-app debug (read only) 2049393 2049393 0 0.0
(read/write) 139632 139632 0 0.0
.bss 71584 71584 0 0.0
.data 1768 1768 0 0.0
.data.rel.ro 60488 60488 0 0.0
.dynamic 608 608 0 0.0
.got 4504 4504 0 0.0
.init 27 27 0 0.0
.init_array 648 648 0 0.0
.rodata 177235 177235 0 0.0
.text 1713762 1713762 0 0.0
ota-requestor-app debug (read only) 2078689 2078689 0 0.0
(read/write) 142440 142440 0 0.0
.bss 72224 72224 0 0.0
.data 1992 1992 0 0.0
.data.rel.ro 62584 62584 0 0.0
.dynamic 592 592 0 0.0
.got 4344 4344 0 0.0
.init 27 27 0 0.0
.init_array 672 672 0 0.0
.rodata 173404 173404 0 0.0
.text 1745426 1745426 0 0.0
shell debug (read only) 2549049 2549049 0 0.0
(read/write) 198256 198256 0 0.0
.bss 114408 114408 0 0.0
.data 1376 1376 0 0.0
.data.rel.ro 76744 76744 0 0.0
.dynamic 592 592 0 0.0
.got 4184 4184 0 0.0
.init 27 27 0 0.0
.init_array 928 928 0 0.0
.rodata 219122 219122 0 0.0
.text 2167442 2167442 0 0.0
thermostat-no-ble arm64 (read only) 2343156 2343156 0 0.0
(read/write) 175009 175009 0 0.0
.bss 86353 86353 0 0.0
.data 1520 1520 0 0.0
.data.rel.ro 79336 79336 0 0.0
.dynamic 560 560 0 0.0
.got 4768 4768 0 0.0
.init 24 24 0 0.0
.init_array 376 376 0 0.0
.rodata 146980 146980 0 0.0
.text 1966352 1966352 0 0.0
tv-app debug (read only) 2840193 2840193 0 0.0
(read/write) 277408 277408 0 0.0
.bss 189528 189528 0 0.0
.data 4672 4672 0 0.0
.data.rel.ro 76960 76960 0 0.0
.dynamic 592 592 0 0.0
.got 4720 4720 0 0.0
.init 27 27 0 0.0
.init_array 928 928 0 0.0
.rodata 219281 219281 0 0.0
.text 2437634 2437634 0 0.0
tv-casting-app debug (read only) 5402937 5402937 0 0.0
(read/write) 223680 223680 0 0.0
.bss 77144 77144 0 0.0
.data 2368 2368 0 0.0
.data.rel.ro 137952 137952 0 0.0
.dynamic 608 608 0 0.0
.got 4728 4728 0 0.0
.init 27 27 0 0.0
.init_array 864 864 0 0.0
.rodata 337857 337857 0 0.0
.text 4704770 4704770 0 0.0
mbed lock-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2418600 2418600 0 0.0
.bss 201596 201596 0 0.0
.data 5872 5872 0 0.0
.text 1381244 1381244 0 0.0
nrfconnect all-clusters-app nrf52840dk_nrf52840 (read/write) 1176903 1176903 0 0.0
bss 138368 138368 0 0.0
rodata 152256 152256 0 0.0
text 807524 807524 0 0.0
p6 all-clusters-app default (read/write) 2529568 2529568 0 0.0
.bss 135104 135104 0 0.0
.data 2808 2808 0 0.0
.text 1487832 1487832 0 0.0
light-app default (read/write) 2418504 2418504 0 0.0
.bss 128432 128432 0 0.0
.data 2608 2608 0 0.0
.text 1376768 1376768 0 0.0
lock-app default (read/write) 2429152 2429152 0 0.0
.bss 128248 128248 0 0.0
.data 2568 2568 0 0.0
.text 1387416 1387416 0 0.0
telink light-switch-app tlsr9518adk80d (read/write) 781904 781904 0 0.0
bss 70608 70608 0 0.0
noinit 40416 40416 0 0.0
text 552922 552922 0 0.0
lighting-app tlsr9518adk80d (read/write) 801988 801988 0 0.0
bss 70864 70864 0 0.0
noinit 40416 40416 0 0.0
text 569688 569688 0 0.0

@kghost kghost merged commit d79a0e3 into project-chip:master May 17, 2022
@kghost kghost deleted the test-3 branch May 17, 2022 18:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants