Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of mbed-os by
build_travis.py
00001 #!/usr/bin/env python2 00002 00003 """ 00004 Travis-CI build script 00005 00006 mbed SDK 00007 Copyright (c) 2011-2013 ARM Limited 00008 00009 Licensed under the Apache License, Version 2.0 (the "License"); 00010 you may not use this file except in compliance with the License. 00011 You may obtain a copy of the License at 00012 00013 http://www.apache.org/licenses/LICENSE-2.0 00014 00015 Unless required by applicable law or agreed to in writing, software 00016 distributed under the License is distributed on an "AS IS" BASIS, 00017 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 00018 See the License for the specific language governing permissions and 00019 limitations under the License. 00020 """ 00021 00022 import os 00023 import sys 00024 00025 ################################################################################ 00026 # Configure builds here 00027 # "libs" can contain "dsp", "rtos", "eth", "usb_host", "usb", "ublox", "fat" 00028 00029 build_list = ( 00030 { "target": "LPC1768", "toolchains": "GCC_ARM", "libs": ["dsp", "rtos", "eth", "usb_host", "usb", "ublox", "fat"] }, 00031 { "target": "LPC2368", "toolchains": "GCC_ARM", "libs": ["fat"] }, 00032 { "target": "LPC2460", "toolchains": "GCC_ARM", "libs": ["rtos", "usb_host", "usb", "fat"] }, 00033 { "target": "LPC11U24", "toolchains": "GCC_ARM", "libs": ["dsp", "rtos", "fat"] }, 00034 { "target": "OC_MBUINO", "toolchains": "GCC_ARM", "libs": ["fat"] }, 00035 00036 { "target": "LPC11U24_301", "toolchains": "GCC_ARM", "libs": ["fat"] }, 00037 00038 { "target": "B96B_F446VE", "toolchains": "GCC_ARM", "libs": ["dsp", "fat"] }, 00039 { "target": "NUCLEO_L053R8", "toolchains": "GCC_ARM", "libs": ["dsp", "fat"] }, 00040 { "target": "NUCLEO_L152RE", "toolchains": "GCC_ARM", "libs": ["dsp", "rtos", "fat"] }, 00041 { "target": "NUCLEO_F030R8", "toolchains": "GCC_ARM", "libs": ["dsp", "fat"] }, 00042 { "target": "NUCLEO_F031K6", "toolchains": "GCC_ARM", "libs": ["dsp", "fat"] }, 00043 { "target": "NUCLEO_F042K6", "toolchains": "GCC_ARM", "libs": ["dsp", "fat"] }, 00044 { "target": "NUCLEO_F070RB", "toolchains": "GCC_ARM", "libs": ["dsp", "fat"] }, 00045 { "target": "NUCLEO_F072RB", "toolchains": "GCC_ARM", "libs": ["dsp", "rtos", "fat"] }, 00046 { "target": "NUCLEO_F091RC", "toolchains": "GCC_ARM", "libs": ["dsp", "rtos", "fat"] }, 00047 { "target": "NUCLEO_F103RB", "toolchains": "GCC_ARM", "libs": ["rtos", "fat"] }, 00048 { "target": "NUCLEO_F207ZG", "toolchains": "GCC_ARM", "libs": ["dsp", "rtos", "fat"] }, 00049 { "target": "NUCLEO_F302R8", "toolchains": "GCC_ARM", "libs": ["dsp", "rtos", "fat"] }, 00050 { "target": "NUCLEO_F303K8", "toolchains": "GCC_ARM", "libs": ["dsp", "rtos", "fat"] }, 00051 { "target": "NUCLEO_F303RE", "toolchains": "GCC_ARM", "libs": ["dsp", "rtos", "fat"] }, 00052 { "target": "NUCLEO_F303ZE", "toolchains": "GCC_ARM", "libs": ["dsp", "rtos", "fat"] }, 00053 { "target": "NUCLEO_F334R8", "toolchains": "GCC_ARM", "libs": ["dsp", "rtos", "fat"] }, 00054 { "target": "NUCLEO_F401RE", "toolchains": "GCC_ARM", "libs": ["dsp", "rtos", "fat"] }, 00055 { "target": "NUCLEO_F410RB", "toolchains": "GCC_ARM", "libs": ["dsp", "rtos", "fat"] }, 00056 { "target": "NUCLEO_F411RE", "toolchains": "GCC_ARM", "libs": ["dsp", "rtos", "fat"] }, 00057 { "target": "NUCLEO_L432KC", "toolchains": "GCC_ARM", "libs": ["dsp", "fat"] }, 00058 { "target": "NUCLEO_L476RG", "toolchains": "GCC_ARM", "libs": ["dsp", "fat"] }, 00059 { "target": "NUCLEO_L011K4", "toolchains": "GCC_ARM", "libs": ["dsp"] }, 00060 { "target": "NUCLEO_L031K6", "toolchains": "GCC_ARM", "libs": ["dsp"] }, 00061 { "target": "NUCLEO_L073RZ", "toolchains": "GCC_ARM", "libs": ["dsp", "fat"] }, 00062 { "target": "NUCLEO_F429ZI", "toolchains": "GCC_ARM", "libs": ["dsp", "rtos", "fat"] }, 00063 { "target": "NUCLEO_F446RE", "toolchains": "GCC_ARM", "libs": ["dsp", "fat"] }, 00064 { "target": "NUCLEO_F446ZE", "toolchains": "GCC_ARM", "libs": ["dsp", "fat"] }, 00065 { "target": "NUCLEO_F746ZG", "toolchains": "GCC_ARM", "libs": ["dsp", "rtos", "fat"] }, 00066 { "target": "NUCLEO_F767ZI", "toolchains": "GCC_ARM", "libs": ["dsp", "rtos", "fat"] }, 00067 00068 { "target": "MOTE_L152RC", "toolchains": "GCC_ARM", "libs": ["dsp", "rtos", "fat"] }, 00069 00070 { "target": "ELMO_F411RE", "toolchains": "GCC_ARM", "libs": ["dsp", "fat"] }, 00071 00072 { "target": "MTS_MDOT_F405RG", "toolchains": "GCC_ARM", "libs": ["dsp", "rtos"] }, 00073 { "target": "MTS_MDOT_F411RE", "toolchains": "GCC_ARM", "libs": ["dsp", "rtos"] }, 00074 { "target": "MTS_DRAGONFLY_F411RE", "toolchains": "GCC_ARM", "libs": ["dsp", "fat"] }, 00075 { "target": "ARCH_MAX", "toolchains": "GCC_ARM", "libs": ["dsp", "rtos", "fat"] }, 00076 00077 { "target": "DISCO_F051R8", "toolchains": "GCC_ARM", "libs": ["dsp", "fat"] }, 00078 { "target": "DISCO_F334C8", "toolchains": "GCC_ARM", "libs": ["dsp", "rtos", "fat"] }, 00079 { "target": "DISCO_F401VC", "toolchains": "GCC_ARM", "libs": ["dsp", "fat"] }, 00080 { "target": "DISCO_F407VG", "toolchains": "GCC_ARM", "libs": ["dsp", "rtos", "fat"] }, 00081 { "target": "DISCO_F429ZI", "toolchains": "GCC_ARM", "libs": ["dsp", "rtos", "fat"] }, 00082 { "target": "DISCO_F469NI", "toolchains": "GCC_ARM", "libs": ["dsp", "rtos", "fat"] }, 00083 { "target": "DISCO_F746NG", "toolchains": "GCC_ARM", "libs": ["dsp", "fat"] }, 00084 { "target": "DISCO_F769NI", "toolchains": "GCC_ARM", "libs": ["dsp", "rtos", "fat"] }, 00085 00086 { "target": "LPC1114", "toolchains": "GCC_ARM", "libs": ["dsp", "rtos", "fat"] }, 00087 { "target": "LPC11U35_401", "toolchains": "GCC_ARM", "libs": ["dsp", "rtos", "fat"] }, 00088 { "target": "UBLOX_C027", "toolchains": "GCC_ARM", "libs": ["dsp", "rtos", "fat"] }, 00089 { "target": "LPC11U35_501", "toolchains": "GCC_ARM", "libs": ["dsp", "fat"] }, 00090 { "target": "LPC11U68", "toolchains": "GCC_ARM", "libs": ["dsp", "rtos", "fat"] }, 00091 { "target": "LPC11U37H_401", "toolchains": "GCC_ARM", "libs": ["dsp", "fat"] }, 00092 00093 { "target": "KL05Z", "toolchains": "GCC_ARM", "libs": ["dsp", "rtos", "fat"] }, 00094 { "target": "KL25Z", "toolchains": "GCC_ARM", "libs": ["dsp", "rtos", "usb", "fat"] }, 00095 { "target": "KL27Z", "toolchains": "GCC_ARM", "libs": ["dsp", "rtos", "usb", "fat"] }, 00096 { "target": "KL43Z", "toolchains": "GCC_ARM", "libs": ["dsp", "rtos", "usb", "fat"] }, 00097 { "target": "KL46Z", "toolchains": "GCC_ARM", "libs": ["dsp", "rtos", "usb", "fat"] }, 00098 { "target": "K20D50M", "toolchains": "GCC_ARM", "libs": ["dsp", "fat"] }, 00099 { "target": "TEENSY3_1", "toolchains": "GCC_ARM", "libs": ["dsp", "fat"] }, 00100 { "target": "K64F", "toolchains": "GCC_ARM", "libs": ["dsp", "rtos", "usb", "fat"] }, 00101 { "target": "LPC4088", "toolchains": "GCC_ARM", "libs": ["dsp", "rtos", "usb", "fat"] }, 00102 { "target": "ARCH_PRO", "toolchains": "GCC_ARM", "libs": ["dsp", "rtos", "fat"] }, 00103 { "target": "LPC1549", "toolchains": "GCC_ARM", "libs": ["dsp", "rtos", "fat"] }, 00104 { "target": "NRF51822", "toolchains": "GCC_ARM", "libs": ["dsp", "rtos", "fat"] }, 00105 { "target": "DELTA_DFCM_NNN40", "toolchains": "GCC_ARM", "libs": ["dsp", "fat"] }, 00106 { "target": "NRF51_DK", "toolchains": "GCC_ARM", "libs": ["dsp", "rtos", "fat"] }, 00107 { "target": "NRF51_MICROBIT", "toolchains": "GCC_ARM", "libs": ["dsp", "rtos", "fat"] }, 00108 00109 { "target": "EFM32ZG_STK3200", "toolchains": "GCC_ARM", "libs": ["dsp"] }, 00110 { "target": "EFM32HG_STK3400", "toolchains": "GCC_ARM", "libs": ["dsp", "rtos", "usb"] }, 00111 { "target": "EFM32LG_STK3600", "toolchains": "GCC_ARM", "libs": ["dsp", "rtos", "usb"] }, 00112 { "target": "EFM32GG_STK3700", "toolchains": "GCC_ARM", "libs": ["dsp", "rtos", "usb"] }, 00113 { "target": "EFM32WG_STK3800", "toolchains": "GCC_ARM", "libs": ["dsp", "rtos", "usb"] }, 00114 { "target": "EFM32PG_STK3401", "toolchains": "GCC_ARM", "libs": ["dsp", "rtos"] }, 00115 00116 { "target": "MAXWSNENV", "toolchains": "GCC_ARM", "libs": ["dsp", "fat"] }, 00117 { "target": "MAX32600MBED", "toolchains": "GCC_ARM", "libs": ["dsp", "fat"] }, 00118 { "target": "MAX32620HSP", "toolchains": "GCC_ARM", "libs": ["dsp", "fat"] }, 00119 00120 { "target": "RZ_A1H", "toolchains": "GCC_ARM", "libs": ["fat"] }, 00121 00122 { "target": "SAMR21G18A", "toolchains": "GCC_ARM", "libs": ["dsp", "fat"] }, 00123 { "target": "SAMD21J18A", "toolchains": "GCC_ARM", "libs": ["dsp", "fat"] }, 00124 { "target": "SAMD21G18A", "toolchains": "GCC_ARM", "libs": ["dsp", "fat"] }, 00125 { "target": "SAML21J18A", "toolchains": "GCC_ARM", "libs": ["dsp", "fat"] }, 00126 ) 00127 00128 ################################################################################ 00129 # Configure example test building (linking against external mbed SDK libraries liek fat or rtos) 00130 00131 linking_list = [ 00132 {"target": "LPC1768", 00133 "toolchains": "GCC_ARM", 00134 "tests": {"" : ["MBED_2", "MBED_10", "MBED_11", "MBED_15", "MBED_16", "MBED_17"], 00135 "eth" : ["NET_1", "NET_2", "NET_3", "NET_4"], 00136 "fat" : ["MBED_A12", "MBED_19", "PERF_1", "PERF_2", "PERF_3"], 00137 "rtos" : ["RTOS_1", "RTOS_2", "RTOS_3"], 00138 "usb" : ["USB_1", "USB_2" ,"USB_3"], 00139 } 00140 } 00141 ] 00142 00143 ################################################################################ 00144 00145 # Driver 00146 00147 def run_builds(dry_run): 00148 for build in build_list: 00149 toolchain_list = build["toolchains"] 00150 if type(toolchain_list) != type([]): toolchain_list = [toolchain_list] 00151 for toolchain in toolchain_list: 00152 cmdline = "python tools/build.py -m %s -t %s -j 4 -c --silent "% (build["target"], toolchain) 00153 libs = build.get("libs", []) 00154 if libs: 00155 cmdline = cmdline + " ".join(["--" + l for l in libs]) 00156 print "Executing: " + cmdline 00157 if not dry_run: 00158 if os.system(cmdline) != 0: 00159 sys.exit(1) 00160 00161 00162 def run_test_linking(dry_run): 00163 """ Function run make.py commands to build and link simple mbed SDK 00164 tests against few libraries to make sure there are no simple linking errors. 00165 """ 00166 for link in linking_list: 00167 toolchain_list = link["toolchains"] 00168 if type(toolchain_list) != type([]): 00169 toolchain_list = [toolchain_list] 00170 for toolchain in toolchain_list: 00171 tests = link["tests"] 00172 # Call make.py for each test group for particular library 00173 for test_lib in tests: 00174 test_names = tests[test_lib] 00175 test_lib_switch = "--" + test_lib if test_lib else "" 00176 cmdline = "python tools/make.py -m %s -t %s -c --silent %s -n %s " % (link["target"], toolchain, test_lib_switch, ",".join(test_names)) 00177 print "Executing: " + cmdline 00178 if not dry_run: 00179 if os.system(cmdline) != 0: 00180 sys.exit(1) 00181 00182 def run_test_testsuite(dry_run): 00183 cmdline = "python tools/singletest.py --version" 00184 print "Executing: " + cmdline 00185 if not dry_run: 00186 if os.system(cmdline) != 0: 00187 sys.exit(1) 00188 00189 if __name__ == "__main__": 00190 run_builds("-s" in sys.argv) 00191 run_test_linking("-s" in sys.argv) 00192 run_test_testsuite("-s" in sys.argv)
Generated on Tue Jul 12 2022 13:15:32 by
