Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding --include-unsupported option when building tests #1768

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion workspace_tools/make.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,11 @@
dest="macros",
help="Add a macro definition")

parser.add_option("--include-unsupported",
action="store_true",
dest="include_unsupported",
help="Allow 'unsupported' tests to be built")

# Local run
parser.add_option("--automated", action="store_true", dest="automated",
default=False, help="Automated test")
Expand Down Expand Up @@ -217,7 +222,7 @@
if options.duration is not None: test.duration = options.duration;
if options.extra is not None: test.extra_files = options.extra

if not test.is_supported(mcu, toolchain):
if not options.include_unsupported and not test.is_supported(mcu, toolchain):
print 'The selected test is not supported on target %s with toolchain %s' % (mcu, toolchain)
sys.exit()

Expand Down
1 change: 1 addition & 0 deletions workspace_tools/singletest.py
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,7 @@ def get_version():
_opts_peripheral_by_names=opts.peripheral_by_names,
_opts_test_only_peripheral=opts.test_only_peripheral,
_opts_test_only_common=opts.test_only_common,
_opts_include_unsupported=opts.include_unsupported,
_opts_verbose_skipped_tests=opts.verbose_skipped_tests,
_opts_verbose_test_result_only=opts.verbose_test_result_only,
_opts_verbose=opts.verbose,
Expand Down
12 changes: 11 additions & 1 deletion workspace_tools/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@ def __init__(self,
_opts_peripheral_by_names=None,
_opts_test_only_peripheral=False,
_opts_test_only_common=False,
_opts_include_unsupported=False,
_opts_verbose_skipped_tests=False,
_opts_verbose_test_result_only=False,
_opts_verbose=False,
Expand Down Expand Up @@ -231,6 +232,7 @@ def __init__(self,
self.opts_peripheral_by_names = _opts_peripheral_by_names
self.opts_test_only_peripheral = _opts_test_only_peripheral
self.opts_test_only_common = _opts_test_only_common
self.opts_include_unsupported = _opts_include_unsupported
self.opts_verbose_skipped_tests = _opts_verbose_skipped_tests
self.opts_verbose_test_result_only = _opts_verbose_test_result_only
self.opts_verbose = _opts_verbose
Expand Down Expand Up @@ -649,7 +651,10 @@ def get_valid_tests(self, test_map_keys, target, toolchain, test_ids, include_no
print self.logger.log_line(self.logger.LogType.INFO, 'Non automated test skipped for target %s'% (target))
continue

if test.is_supported(target, toolchain):
if self.opts_include_unsupported:
# If specfied, build all tests
valid_test_map_keys.append(test_id)
elif test.is_supported(target, toolchain):
if test.peripherals is None and self.opts_only_build_tests:
# When users are using 'build only flag' and test do not have
# specified peripherals we can allow test building by default
Expand Down Expand Up @@ -1775,6 +1780,11 @@ def get_default_test_options_parser():
default=False,
action="store_true",
help='Test only board internals. Skip perpherials tests and perform common tests')

parser.add_option("--include-unsupported",
action="store_true",
dest="include_unsupported",
help="Allow 'unsupported' tests to be built")

parser.add_option('-n', '--test-by-names',
dest='test_by_names',
Expand Down