Skip to content

Commit 7b20b0f

Browse files
committed
Making mcu and toolchain required parameters for test.py
Also renaming 'target' variable to 'mcu' to match make.py
1 parent 1618e60 commit 7b20b0f

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

tools/test.py

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
from tools.build_api import build_project, build_library
3232
from tools.build_api import print_build_memory_usage_results
3333
from tools.targets import TARGET_MAP
34-
from tools.utils import mkdir, ToolException, NotSupportedException
34+
from tools.utils import mkdir, ToolException, NotSupportedException, args_error
3535
from tools.test_exporters import ReportExporter, ResultExporterType
3636
from utils import argparse_filestring_type, argparse_lowercase_type, argparse_many
3737
from utils import argparse_dir_not_parent
@@ -105,12 +105,19 @@
105105
all_tests = {}
106106
tests = {}
107107

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")
109116
toolchain = options.tool[0]
110117

111118
# Find all tests in the relevant paths
112119
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))
114121

115122
# Filter tests by name if specified
116123
if options.names:
@@ -160,7 +167,7 @@
160167
library_build_success = False
161168
try:
162169
# Build sources
163-
build_library(base_source_paths, options.build_dir, target, toolchain,
170+
build_library(base_source_paths, options.build_dir, mcu, toolchain,
164171
options=options.options,
165172
jobs=options.jobs,
166173
clean=options.clean,
@@ -187,7 +194,7 @@
187194
print "Failed to build library"
188195
else:
189196
# 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,
191198
options=options.options,
192199
clean=options.clean,
193200
report=build_report,

0 commit comments

Comments
 (0)