twister: Fix memory footprint reporting logic

With the previous logic memory footprint can only be saved in a report
if a given test/sample was fully executed and passed (built and run),
hence build-only tests were not providing these metrics. This commit
modifies the logic so that it is enough to have the build successful
to be able to get the memory footprint.

Signed-off-by: Maciej Perkowski <Maciej.Perkowski@nordicsemi.no>
This commit is contained in:
Maciej Perkowski 2021-04-15 11:37:39 +02:00 committed by Anas Nashif
commit 484ef6710d

View file

@ -3650,14 +3650,15 @@ class TestSuite(DisablePyTestCollectionMixin):
"arch": instance.platform.arch, "arch": instance.platform.arch,
"platform": p, "platform": p,
} }
if ram_size:
testcase["ram_size"] = ram_size
if rom_size:
testcase["rom_size"] = rom_size
if instance.results[k] in ["PASS"]: if instance.results[k] in ["PASS"]:
testcase["status"] = "passed" testcase["status"] = "passed"
if instance.handler: if instance.handler:
testcase["execution_time"] = handler_time testcase["execution_time"] = handler_time
if ram_size:
testcase["ram_size"] = ram_size
if rom_size:
testcase["rom_size"] = rom_size
elif instance.results[k] in ['FAIL', 'BLOCK'] or instance.status in ["error", "failed", "timeout"]: elif instance.results[k] in ['FAIL', 'BLOCK'] or instance.status in ["error", "failed", "timeout"]:
testcase["status"] = "failed" testcase["status"] = "failed"