|
31 | 31 | from tools.build_api import build_project, build_library
|
32 | 32 | from tools.build_api import print_build_memory_usage_results
|
33 | 33 | from tools.targets import TARGET_MAP
|
34 |
| -from tools.utils import mkdir, ToolException, NotSupportedException |
| 34 | +from tools.utils import mkdir, ToolException, NotSupportedException, args_error |
35 | 35 | from tools.test_exporters import ReportExporter, ResultExporterType
|
36 | 36 | from utils import argparse_filestring_type, argparse_lowercase_type, argparse_many
|
37 | 37 | from utils import argparse_dir_not_parent
|
|
105 | 105 | all_tests = {}
|
106 | 106 | tests = {}
|
107 | 107 |
|
108 |
| - target = options.mcu[0] |
| 108 | + # Target |
| 109 | + if options.mcu is None : |
| 110 | + args_error(parser, "[ERROR] You should specify an MCU") |
| 111 | + mcu = options.mcu[0] |
| 112 | + |
| 113 | + # Toolchain |
| 114 | + if options.tool is None: |
| 115 | + args_error(parser, "[ERROR] You should specify a TOOLCHAIN") |
109 | 116 | toolchain = options.tool[0]
|
110 | 117 |
|
111 | 118 | # Find all tests in the relevant paths
|
112 | 119 | for path in all_paths:
|
113 |
| - all_tests.update(find_tests(path, target, toolchain, options.options)) |
| 120 | + all_tests.update(find_tests(path, mcu, toolchain, options.options)) |
114 | 121 |
|
115 | 122 | # Filter tests by name if specified
|
116 | 123 | if options.names:
|
|
160 | 167 | library_build_success = False
|
161 | 168 | try:
|
162 | 169 | # Build sources
|
163 |
| - build_library(base_source_paths, options.build_dir, target, toolchain, |
| 170 | + build_library(base_source_paths, options.build_dir, mcu, toolchain, |
164 | 171 | options=options.options,
|
165 | 172 | jobs=options.jobs,
|
166 | 173 | clean=options.clean,
|
|
187 | 194 | print "Failed to build library"
|
188 | 195 | else:
|
189 | 196 | # Build all the tests
|
190 |
| - test_build_success, test_build = build_tests(tests, [options.build_dir], options.build_dir, target, toolchain, |
| 197 | + test_build_success, test_build = build_tests(tests, [options.build_dir], options.build_dir, mcu, toolchain, |
191 | 198 | options=options.options,
|
192 | 199 | clean=options.clean,
|
193 | 200 | report=build_report,
|
|
0 commit comments