diff --git a/scripts/pylib/twister/twisterlib.py b/scripts/pylib/twister/twisterlib.py index 13fea5666a0..c48b6b0569d 100755 --- a/scripts/pylib/twister/twisterlib.py +++ b/scripts/pylib/twister/twisterlib.py @@ -3310,16 +3310,16 @@ class TestSuite(DisablePyTestCollectionMixin): if build_only: instance.run = False - if test_only and instance.run: - pipeline.put({"op": "run", "test": instance}) - else: - if instance.status not in ['passed', 'skipped', 'error']: - logger.debug(f"adding {instance.name}") - instance.status = None + if instance.status not in ['passed', 'skipped', 'error']: + logger.debug(f"adding {instance.name}") + instance.status = None + if test_only and instance.run: + pipeline.put({"op": "run", "test": instance}) + else: pipeline.put({"op": "cmake", "test": instance}) - # If the instance got 'error' status before, proceed to the report stage - if instance.status == "error": - pipeline.put({"op": "report", "test": instance}) + # If the instance got 'error' status before, proceed to the report stage + if instance.status == "error": + pipeline.put({"op": "report", "test": instance}) def pipeline_mgr(self, pipeline, done_queue, lock, results): while True: