From 858196ffffa1d6c3103af09353ab76b3cbbf8453 Mon Sep 17 00:00:00 2001 From: Przemek Wirkus Date: Wed, 12 Nov 2014 18:01:44 +0000 Subject: [PATCH] When users are using 'build only flag' (switch -O) and test do not have specified peripherals (muts.json file is just empty dictionary) we can allow test building by default. This supposed to be Yotta related improvement. --- workspace_tools/singletest.py | 10 +++++----- workspace_tools/test_api.py | 12 +++++++++--- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/workspace_tools/singletest.py b/workspace_tools/singletest.py index 458593c99e..41d2af270d 100644 --- a/workspace_tools/singletest.py +++ b/workspace_tools/singletest.py @@ -143,16 +143,16 @@ if __name__ == '__main__': parser.print_help() exit(-1) - # Only prints read MUTs configuration - if MUTs and opts.verbose_test_configuration_only: + if opts.verbose_test_configuration_only: print "MUTs configuration in %s:"% opts.muts_spec_filename - print print_muts_configuration_from_json(MUTs) + if MUTs: + print print_muts_configuration_from_json(MUTs) print print "Test specification in %s:"% opts.test_spec_filename - print print_test_configuration_from_json(test_spec) + if test_spec: + print print_test_configuration_from_json(test_spec) exit(0) - # Verbose test specification and MUTs configuration if MUTs and opts.verbose: print print_muts_configuration_from_json(MUTs) diff --git a/workspace_tools/test_api.py b/workspace_tools/test_api.py index ee177be5d5..4f9baac886 100644 --- a/workspace_tools/test_api.py +++ b/workspace_tools/test_api.py @@ -370,10 +370,16 @@ class SingleTestRunner(object): continue if test.automated and test.is_supported(target, toolchain): - if not self.is_peripherals_available(target, test.peripherals): + 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 + pass + elif not self.is_peripherals_available(target, test.peripherals): if self.opts_verbose_skipped_tests: - test_peripherals = test.peripherals if test.peripherals else [] - print self.logger.log_line(self.logger.LogType.INFO, 'Peripheral %s test skipped for target %s'% (",".join(test_peripherals), target)) + if test.peripherals: + print self.logger.log_line(self.logger.LogType.INFO, 'Peripheral %s test skipped for target %s'% (",".join(test.peripherals), target)) + else: + print self.logger.log_line(self.logger.LogType.INFO, 'Test %s skipped for target %s'% (test_id, target)) test_suite_properties['skipped'].append(test_id) continue