From 45ad394ca6135f9387f2f43194ae37314d155d61 Mon Sep 17 00:00:00 2001 From: Sarah Marsh Date: Mon, 12 Sep 2016 10:43:55 -0500 Subject: [PATCH] New build tests. *Changes* - Parallel export - mbed-os tests added - specified release version (default to 5) - default tests AND targets dependent on specified release version --- tools/export/exporters.py | 4 ++-- tools/export/iar/__init__.py | 4 ++-- tools/project_api.py | 1 + tools/test/export/build_test.py | 6 ++++-- 4 files changed, 9 insertions(+), 6 deletions(-) diff --git a/tools/export/exporters.py b/tools/export/exporters.py index bab9d9b910..ba31064e58 100644 --- a/tools/export/exporters.py +++ b/tools/export/exporters.py @@ -119,11 +119,11 @@ class Exporter(object): source_files.extend(getattr(self.resources, key)) return list(set([os.path.dirname(src) for src in source_files])) - def check_supported(self, ide): + def check_supported(self): """Indicated if this combination of IDE and MCU is supported""" if self.target not in self.TARGETS or \ self.TOOLCHAIN not in TARGET_MAP[self.target].supported_toolchains: - return False + raise TargetNotSupportedException() return True def gen_file(self, template_file, data, target_file): diff --git a/tools/export/iar/__init__.py b/tools/export/iar/__init__.py index 0c1caa9bb5..a8f03682ff 100644 --- a/tools/export/iar/__init__.py +++ b/tools/export/iar/__init__.py @@ -120,11 +120,11 @@ class IAR(Exporter): iar_exe = "IarBuild.exe" else: iar_exe = join('C:', sep, - 'Program Files (x86)', 'IAR Systems', + 'Program Files (x86)', 'IAR Systems', 'Embedded Workbench 7.5', 'common', 'bin', 'IarBuild.exe') if not exists(iar_exe): - raise Exception("UV4.exe not found. Add to path.") + raise Exception("IarBuild.exe not found. Add to path.") cmd = [iar_exe, proj_file, '-build', self.project_name] p = Popen(cmd, stdin=PIPE, stdout=PIPE, stderr=PIPE) diff --git a/tools/project_api.py b/tools/project_api.py index 99d8be5804..57bb1d10a0 100644 --- a/tools/project_api.py +++ b/tools/project_api.py @@ -86,6 +86,7 @@ def generate_project_files(resources, export_path, target, name, toolchain, ide, exporter_cls, _ = get_exporter_toolchain(ide) exporter = exporter_cls(target, export_path, name, toolchain, extra_symbols=macros, resources=resources) + exporter.check_supported() exporter.generate() files = exporter.generated_files return files, exporter diff --git a/tools/test/export/build_test.py b/tools/test/export/build_test.py index 3d8b284b9b..f03f360d6b 100644 --- a/tools/test/export/build_test.py +++ b/tools/test/export/build_test.py @@ -126,7 +126,7 @@ class ExportBuildTest(object): test_case.ide, test_case.name)) try: - exporter.progen_build() + exporter.build() except FailedBuildException: self.failures.append("%s::%s\t%s" % (test_case.mcu, test_case.ide, @@ -187,6 +187,8 @@ def check_valid_mbed_os(test): supported = columnate([t for t in all_os_tests.keys()]) raise ArgumentTypeError("Program with name '{0}' not found. " "Supported tests are: \n{1}".format(test,supported)) + + def check_version(version): """Check if the specified version is valid args: @@ -201,7 +203,7 @@ def check_version(version): def main(): """Entry point""" - ide_list = ["iar", "uvision", "uvision4"] + ide_list = ["iar", "uvision"] default_v2 = [test_name_known("MBED_BLINKY")] default_v5 = [check_valid_mbed_os('tests-mbedmicro-rtos-mbed-basic')]