@@ -2658,17 +2658,10 @@ def test_(toolchain=None, target=None, compile_list=False, run_list=False,
2658
2658
# Save original working directory
2659
2659
orig_path = getcwd ()
2660
2660
2661
- target = program .get_target (target )
2662
- tchain = program .get_toolchain (toolchain )
2663
2661
macros = program .get_macros ()
2664
2662
tools_dir = program .get_tools ()
2665
2663
build_and_run_tests = not compile_list and not run_list and not compile_only and not run_only
2666
2664
2667
- icetea_command_base = [python_cmd , '-u' , os .path .join (tools_dir , 'run_icetea.py' )] \
2668
- + (['-m' , target , '-t' , tchain ]) \
2669
- + (['-n' , tests_by_name ] if tests_by_name else []) \
2670
- + (['-v' ] if verbose else [])
2671
-
2672
2665
# Prepare environment variables
2673
2666
env = program .get_env ()
2674
2667
@@ -2704,6 +2697,14 @@ def test_(toolchain=None, target=None, compile_list=False, run_list=False,
2704
2697
else :
2705
2698
warning ("Unit testing is not supported with this Mbed OS version." )
2706
2699
else :
2700
+ target = program .get_target (target )
2701
+ tchain = program .get_toolchain (toolchain )
2702
+
2703
+ icetea_command_base = [python_cmd , '-u' , os .path .join (tools_dir , 'run_icetea.py' )] \
2704
+ + (['-m' , target , '-t' , tchain ]) \
2705
+ + (['-n' , tests_by_name ] if tests_by_name else []) \
2706
+ + (['-v' ] if verbose else [])
2707
+
2707
2708
# Setup the source path if not specified
2708
2709
if not source or len (source ) == 0 :
2709
2710
source = [os .path .relpath (program .path , orig_path )]
0 commit comments