4444from workspace_tools .paths import BUILD_DIR
4545from workspace_tools .paths import HOST_TESTS
4646from workspace_tools .utils import ToolException
47+ from workspace_tools .utils import NotSupportedException
4748from workspace_tools .utils import construct_enum
4849from workspace_tools .targets import TARGET_MAP
4950from workspace_tools .test_db import BaseDBAccess
@@ -130,6 +131,7 @@ class SingleTestRunner(object):
130131 TEST_RESULT_NO_IMAGE = "NO_IMAGE"
131132 TEST_RESULT_MBED_ASSERT = "MBED_ASSERT"
132133 TEST_RESULT_BUILD_FAILED = "BUILD_FAILED"
134+ TEST_RESULT_NOT_SUPPORTED = "NOT_SUPPORTED"
133135
134136 GLOBAL_LOOPS_COUNT = 1 # How many times each test should be repeated
135137 TEST_LOOPS_LIST = [] # We redefine no.of loops per test_id
@@ -149,7 +151,8 @@ class SingleTestRunner(object):
149151 "no_image" : TEST_RESULT_NO_IMAGE ,
150152 "end" : TEST_RESULT_UNDEF ,
151153 "mbed_assert" : TEST_RESULT_MBED_ASSERT ,
152- "build_failed" : TEST_RESULT_BUILD_FAILED
154+ "build_failed" : TEST_RESULT_BUILD_FAILED ,
155+ "not_supproted" : TEST_RESULT_NOT_SUPPORTED
153156 }
154157
155158 def __init__ (self ,
@@ -476,27 +479,37 @@ def execute_thread_slice(self, q, target, toolchains, clean, test_ids, build_rep
476479 project_id = test_id ,
477480 project_description = test .get_description ())
478481
479- except ToolException :
482+ except Exception , e :
480483 project_name_str = project_name if project_name is not None else test_id
481- print self .logger .log_line (self .logger .LogType .ERROR , 'There were errors while building project %s' % (project_name_str ))
484+
485+
486+ test_result = self .TEST_RESULT_FAIL
487+
488+ if isinstance (e , ToolException ):
489+ print self .logger .log_line (self .logger .LogType .ERROR , 'There were errors while building project %s' % (project_name_str ))
490+ test_result = self .TEST_RESULT_BUILD_FAILED
491+ elif isinstance (e , NotSupportedException ):
492+ print self .logger .log_line (self .logger .LogType .INFO , 'The project %s is not supported' % (project_name_str ))
493+ test_result = self .TEST_RESULT_NOT_SUPPORTED
494+
482495
483496 # Append test results to global test summary
484497 self .test_summary .append (
485- (self . TEST_RESULT_BUILD_FAILED , target , toolchain , test_id , 'Toolchain build failed' , 0 , 0 , '-' )
498+ (test_result , target , toolchain , test_id , test . get_description () , 0 , 0 , '-' )
486499 )
487500
488501 # Add detailed test result to test summary structure
489502 if test_id not in self .test_summary_ext [target ][toolchain ]:
490503 self .test_summary_ext [target ][toolchain ][test_id ] = []
491504
492505 self .test_summary_ext [target ][toolchain ][test_id ].append ({ 0 : {
493- 'result' : self . TEST_RESULT_BUILD_FAILED ,
506+ 'result' : test_result ,
494507 'output' : '' ,
495508 'target_name' : target ,
496509 'target_name_unique' : target ,
497510 'toolchain_name' : toolchain ,
498511 'id' : test_id ,
499- 'description' : 'Toolchain build failed' ,
512+ 'description' : test . get_description () ,
500513 'elapsed_time' : 0 ,
501514 'duration' : 0 ,
502515 'copy_method' : None
@@ -736,7 +749,8 @@ def generate_test_summary(self, test_summary, shuffle_seed=None):
736749 self .TEST_RESULT_NO_IMAGE : 0 ,
737750 self .TEST_RESULT_TIMEOUT : 0 ,
738751 self .TEST_RESULT_MBED_ASSERT : 0 ,
739- self .TEST_RESULT_BUILD_FAILED : 0
752+ self .TEST_RESULT_BUILD_FAILED : 0 ,
753+ self .TEST_RESULT_NOT_SUPPORTED : 0
740754 }
741755
742756 for test in test_summary :
0 commit comments