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.
tests.py
00001 """ 00002 mbed SDK 00003 Copyright (c) 2011-2013 ARM Limited 00004 00005 Licensed under the Apache License, Version 2.0 (the "License"); 00006 you may not use this file except in compliance with the License. 00007 You may obtain a copy of the License at 00008 00009 http://www.apache.org/licenses/LICENSE-2.0 00010 00011 Unless required by applicable law or agreed to in writing, software 00012 distributed under the License is distributed on an "AS IS" BASIS, 00013 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 00014 See the License for the specific language governing permissions and 00015 limitations under the License. 00016 """ 00017 from tools.paths import * 00018 from tools.data.support import DEFAULT_SUPPORT, CORTEX_ARM_SUPPORT 00019 from argparse import ArgumentTypeError 00020 from tools.utils import columnate 00021 00022 TEST_CMSIS_LIB = join(TEST_DIR, "cmsis", "lib") 00023 TEST_MBED_LIB = join(TEST_DIR, "mbed", "env") 00024 00025 PERIPHERALS = join(TEST_DIR, "peripherals") 00026 BENCHMARKS_DIR = join(TEST_DIR, "benchmarks") 00027 00028 SD = join(TEST_DIR, "sd") 00029 TMP102 = join(PERIPHERALS, 'TMP102') 00030 AT30TSE75X = join(PERIPHERALS, 'AT30TSE75X') 00031 00032 """ 00033 Wiring: 00034 * Ground: 00035 * LPC1*: p1 00036 * KL25Z: GND 00037 00038 * Vout 00039 * LPC1*: p40 00040 * KL25Z: P3V3 00041 00042 * TMP102 (I2C): 00043 * LPC1*: (SDA=p28 , SCL=p27) 00044 * KL25Z: (SDA=PTC9, SCL=PTC8) 00045 * MAXWSNENV: (SDA=TP6, SCL=TP5) 00046 00047 * digital_loop (Digital(In|Out|InOut), InterruptIn): 00048 * Arduino headers: (D0 <-> D7) 00049 * NUCLEO_*: (D2 <-> D9) 00050 * LPC1549: (D2 <-> D7) 00051 * LPC1*: (p5 <-> p25 ) 00052 * KL25Z: (PTA5<-> PTC6) 00053 * MAXWSNENV: (TP3 <-> TP4) 00054 * MAX32600MBED: (P1_0 <-> P4_7) 00055 * VK_RZ_A1H: (P3_2 <-> P5_6) 00056 00057 * port_loop (Port(In|Out|InOut)): 00058 * Arduino headers: (D0 <-> D7), (D1 <-> D6) 00059 * LPC1*: (p5 <-> p25), (p6 <-> p26) 00060 * KL25Z: (PTA5 <-> PTC6), (PTA4 <-> PTC5) 00061 * NUCLEO_F103RB: (PC_6 <-> PB_8), (PC_5 <-> PB_9) 00062 * MAXWSNENV: (TP1 <-> TP3), (TP2 <-> TP4) 00063 * MAX32600MBED: (P1_0 <-> P4_7), (P1_1 <-> P4_6) 00064 * VK_RZ_A1H: (P3_2 <-> P5_6), (P3_7 <-> P5_1) 00065 00066 * analog_loop (AnalogIn, AnalogOut): 00067 * Arduino headers: (A0 <-> A5) 00068 * NUCLEO64: (A0 <-> A2) 00069 * NUCLEO144: (A0 <-> D13) 00070 * LPC1549: (A0 <-> D12) 00071 * LPC1*: (p17 <-> p18 ) 00072 * KL25Z: (PTE30 <-> PTC2) 00073 00074 * analog_pot (AnalogIn): 00075 * Arduino headers: (A0, A1) 00076 * VK_RZ_A1H: (AN0, AN1) 00077 00078 * SD (SPI): 00079 * LPC1*: (mosi=p11 , miso=p12 , sclk=p13 , cs=p14 ) 00080 * KL25Z: (mosi=PTD2, miso=PTD3, sclk=PTD1, cs=PTD0) 00081 00082 * MMA7660 (I2C): 00083 * LPC1*: (SDA=p28 , SCL=p27) 00084 00085 * i2c_loop: 00086 * LPC1768: (p28 <-> p9), (p27 <-> p10) 00087 * NUCLEO64: (D14 <-> D3), (D15 <-> D6) 00088 * NUCLEO144: (D14 <-> PB_11), (D15 <-> PB_10) 00089 00090 * i2c_eeprom: 00091 * LPC1*: (SDA=p28 , SCL=p27) 00092 * KL25Z: (SDA=PTE0, SCL=PTE1) 00093 * VK_RZ_A1H:(SDA=P1_1, SCL=P1_0) 00094 00095 * can_transceiver: 00096 * LPC1768: (RX=p9, TX=p10) 00097 * LPC1549: (RX=D9, TX=D8) 00098 * LPC4088: (RX=p9, TX=p10) 00099 * VK_RZ_A1H:(RX=P5_9, TX=P5_10) 00100 * NUCLEO_F091RC: (RX=PA_11, TX=PA_12) 00101 * NUCLEO_F072RB: (RX=PA_11, TX=PA_12) 00102 * NUCLEO_F042K6: (RX=PA_11, TX=PA_12) 00103 * NUCLEO_F334R8: (RX=PA_11, TX=PA_12) 00104 * NUCLEO_F303RE: (RX=PA_11, TX=PA_12) 00105 * NUCLEO_F303K8: (RX=PA_11, TX=PA_12) 00106 * NUCLEO_F302R8: (RX=PA_11, TX=PA_12) 00107 * NUCLEO_F446RE: (RX=PA_11, TX=PA_12) 00108 * NUCLEO_F446ZE: (RX=PA_11, TX=PA_12) 00109 * DISCO_F469NI: (RX=PB_8, TX=PB_9) 00110 * DISCO_F4269ZI: (RX=PA_11, TX=PA_12) 00111 * NUCLEO_F103RB: (RX=PA_11, TX=PA_12) 00112 * NUCLEO_F746ZG: (RX=PA_11, TX=PA_12) 00113 * DISCO_F746NG: (RX=PB_8, TX=PB_9) 00114 * DISCO_L475VG_IOT01A: (RX=PA_11, TX=PA_12) 00115 * DISCO_L476VG: (RX=PA_11, TX=PA_12) 00116 * NUCLEO_L476RG: (RX=PA_11, TX=PA_12) 00117 * NUCLEO_L432KC: (RX=PA_11, TX=PA_12) 00118 * DISCO_F303VC: (RX=PA_11, TX=PA_12) 00119 * NUCLEO_F412ZG: (RX=PA_11, TX=PA_12) 00120 00121 """ 00122 TESTS = [ 00123 # Automated MBED tests 00124 { 00125 "id": "MBED_A1", "description": "Basic", 00126 "source_dir": join(TEST_DIR, "mbed", "basic"), 00127 "dependencies": [MBED_LIBRARIES, TEST_MBED_LIB], 00128 "automated": True, 00129 }, 00130 { 00131 "id": "MBED_A2", "description": "Semihost file system", 00132 "source_dir": join(TEST_DIR, "mbed", "file"), 00133 "dependencies": [MBED_LIBRARIES, TEST_MBED_LIB], 00134 "automated": True, 00135 "mcu": ["LPC1768", "LPC11U24"] 00136 }, 00137 { 00138 "id": "MBED_A3", "description": "C++ STL", 00139 "source_dir": join(TEST_DIR, "mbed", "stl"), 00140 "dependencies": [MBED_LIBRARIES, TEST_MBED_LIB], 00141 "automated": False, 00142 }, 00143 { 00144 "id": "MBED_A4", "description": "I2C TMP102", 00145 "source_dir": join(TEST_DIR, "mbed", "i2c_TMP102"), 00146 "dependencies": [MBED_LIBRARIES, TEST_MBED_LIB, TMP102], 00147 "automated": True, 00148 "peripherals": ["TMP102"] 00149 }, 00150 { 00151 "id": "MBED_AT30TSE75X", "description": "I2C Temperature Sensor / EEPROM", 00152 "source_dir": join(TEST_DIR, "mbed", "i2c_at30tse75x"), 00153 "dependencies": [MBED_LIBRARIES, TEST_MBED_LIB, AT30TSE75X], 00154 "automated": False, 00155 "peripherals": ["AT30TSE75X"] 00156 }, 00157 { 00158 "id": "MBED_A5", "description": "DigitalIn DigitalOut", 00159 "source_dir": join(TEST_DIR, "mbed", "digitalin_digitalout"), 00160 "dependencies": [MBED_LIBRARIES, TEST_MBED_LIB], 00161 "automated": True, 00162 "peripherals": ["digital_loop"] 00163 }, 00164 { 00165 "id": "MBED_A6", "description": "DigitalInOut", 00166 "source_dir": join(TEST_DIR, "mbed", "digitalinout"), 00167 "dependencies": [MBED_LIBRARIES, TEST_MBED_LIB], 00168 "automated": True, 00169 "peripherals": ["digital_loop"] 00170 }, 00171 { 00172 "id": "MBED_A7", "description": "InterruptIn", 00173 "source_dir": join(TEST_DIR, "mbed", "interruptin"), 00174 "dependencies": [MBED_LIBRARIES, TEST_MBED_LIB], 00175 "automated": True, 00176 "peripherals": ["digital_loop"] 00177 }, 00178 { 00179 "id": "MBED_A8", "description": "Analog", 00180 "source_dir": join(TEST_DIR, "mbed", "analog"), 00181 "dependencies": [MBED_LIBRARIES, TEST_MBED_LIB], 00182 "automated": True, 00183 "peripherals": ["analog_loop"], 00184 "mcu": ["LPC1768", "KL25Z", "K64F", "K66F", "K22F", "LPC4088", "LPC1549", 00185 "NUCLEO_F072RB", "NUCLEO_F091RC", "NUCLEO_F302R8", "NUCLEO_F303K8", "NUCLEO_F303RE", "NUCLEO_F207ZG", 00186 "NUCLEO_F334R8", "NUCLEO_F303ZE", "NUCLEO_L053R8", "DISCO_L072CZ_LRWAN1", "NUCLEO_L073RZ", "NUCLEO_L152RE", 00187 "NUCLEO_F410RB", "NUCLEO_F446RE", "NUCLEO_F446ZE", "NUCLEO_F429ZI", 00188 "DISCO_F407VG", "NUCLEO_F746ZG", "NUCLEO_L476RG", 00189 "DISCO_L053C8", "DISCO_F334C8", "DISCO_L475VG_IOT01A", "DISCO_L476VG", "DISCO_F469NI", "DISCO_F429ZI", "DISCO_F769NI", 00190 "ARCH_MAX", "MAX32600MBED", "MOTE_L152RC", "B96B_F446VE"] 00191 }, 00192 { 00193 "id": "MBED_A9", "description": "Serial Echo at 115200", 00194 "source_dir": join(TEST_DIR, "mbed", "echo"), 00195 "dependencies": [MBED_LIBRARIES, TEST_MBED_LIB], 00196 "automated": True, 00197 #"host_test": "echo" 00198 }, 00199 { 00200 "id": "MBED_A10", "description": "PortOut PortIn", 00201 "source_dir": join(TEST_DIR, "mbed", "portout_portin"), 00202 "dependencies": [MBED_LIBRARIES, TEST_MBED_LIB], 00203 "peripherals": ["port_loop"], 00204 "supported": DEFAULT_SUPPORT, 00205 "automated": True, 00206 }, 00207 { 00208 "id": "MBED_A11", "description": "PortInOut", 00209 "source_dir": join(TEST_DIR, "mbed", "portinout"), 00210 "dependencies": [MBED_LIBRARIES, TEST_MBED_LIB], 00211 "peripherals": ["port_loop"], 00212 "supported": DEFAULT_SUPPORT, 00213 "automated": True, 00214 }, 00215 { 00216 "id": "MBED_A13", "description": "I2C MMA7660 accelerometer", 00217 "source_dir": join(TEST_DIR, "mbed", "i2c_MMA7660"), 00218 "dependencies": [MBED_LIBRARIES, TEST_MBED_LIB, join(PERIPHERALS, 'MMA7660')], 00219 "automated": True, 00220 "peripherals": ["MMA7660"] 00221 }, 00222 { 00223 "id": "MBED_A14", "description": "I2C Master", 00224 "source_dir": join(TEST_DIR, "mbed", "i2c_master"), 00225 "dependencies": [MBED_LIBRARIES, TEST_MBED_LIB,], 00226 }, 00227 { 00228 "id": "MBED_A15", "description": "I2C Slave", 00229 "source_dir": join(TEST_DIR, "mbed", "i2c_slave"), 00230 "dependencies": [MBED_LIBRARIES, TEST_MBED_LIB,], 00231 }, 00232 { 00233 "id": "MBED_A16", "description": "SPI Master", 00234 "source_dir": join(TEST_DIR, "mbed", "spi_master"), 00235 "dependencies": [MBED_LIBRARIES, TEST_MBED_LIB,], 00236 }, 00237 { 00238 "id": "MBED_A17", "description": "SPI Slave", 00239 "source_dir": join(TEST_DIR, "mbed", "spi_slave"), 00240 "dependencies": [MBED_LIBRARIES, TEST_MBED_LIB,], 00241 }, 00242 { 00243 "id": "MBED_A18", "description": "Interrupt vector relocation", 00244 "source_dir": join(TEST_DIR, "mbed", "vtor_reloc"), 00245 "dependencies": [MBED_LIBRARIES, TEST_MBED_LIB,], 00246 "mcu": ["LPC1768"], 00247 "automated": True, 00248 }, 00249 { 00250 "id": "MBED_A19", "description": "I2C EEPROM read/write test", 00251 "source_dir": join(TEST_DIR, "mbed", "i2c_eeprom"), 00252 "dependencies": [MBED_LIBRARIES, TEST_MBED_LIB], 00253 "peripherals": ["24LC256"], 00254 "automated": True, 00255 }, 00256 { 00257 "id": "MBED_A20", "description": "I2C master/slave test", 00258 "source_dir": join(TEST_DIR, "mbed", "i2c_master_slave"), 00259 "dependencies": [MBED_LIBRARIES, TEST_MBED_LIB,], 00260 "automated": True, 00261 "peripherals": ["i2c_loop"] 00262 }, 00263 { 00264 "id": "MBED_A21", "description": "Call function before main (mbed_main)", 00265 "source_dir": join(TEST_DIR, "mbed", "call_before_main"), 00266 "dependencies": [MBED_LIBRARIES, TEST_MBED_LIB], 00267 "automated": True, 00268 }, 00269 { 00270 "id": "MBED_A22", "description": "SPIFI for LPC4088 (test 1)", 00271 "source_dir": join(TEST_DIR, "mbed", "spifi1"), 00272 "dependencies": [MBED_LIBRARIES, TEST_MBED_LIB], 00273 "automated": True, 00274 "mcu": ["LPC4088","LPC4088_DM"] 00275 }, 00276 { 00277 "id": "MBED_A23", "description": "SPIFI for LPC4088 (test 2)", 00278 "source_dir": join(TEST_DIR, "mbed", "spifi2"), 00279 "dependencies": [MBED_LIBRARIES, TEST_MBED_LIB], 00280 "automated": True, 00281 "mcu": ["LPC4088","LPC4088_DM"] 00282 }, 00283 { 00284 "id": "MBED_A24", "description": "Serial echo with RTS/CTS flow control", 00285 "source_dir": join(TEST_DIR, "mbed", "echo_flow_control"), 00286 "dependencies": [MBED_LIBRARIES], 00287 "automated": "True", 00288 "host_test": "echo_flow_control", 00289 "mcu": ["LPC1768"], 00290 "peripherals": ["extra_serial"] 00291 }, 00292 { 00293 "id": "MBED_A25", "description": "I2C EEPROM line read/write test", 00294 "source_dir": join(TEST_DIR, "mbed", "i2c_eeprom_line"), 00295 "dependencies": [MBED_LIBRARIES, TEST_MBED_LIB], 00296 "peripherals": ["24LC256"], 00297 "automated": True, 00298 }, 00299 { 00300 "id": "MBED_A26", "description": "AnalogIn potentiometer test", 00301 "source_dir": join(TEST_DIR, "mbed", "analog_pot"), 00302 "dependencies": [MBED_LIBRARIES, TEST_MBED_LIB], 00303 "peripherals": ["analog_pot"], 00304 "automated": True, 00305 }, 00306 { 00307 "id": "MBED_A27", "description": "CAN loopback test", 00308 "source_dir": join(TEST_DIR, "mbed", "can_loopback"), 00309 "dependencies": [MBED_LIBRARIES, TEST_MBED_LIB], 00310 "automated": True, 00311 "peripherals": ["can_transceiver"], 00312 "mcu": ["LPC1549", "LPC1768","B96B_F446VE", "VK_RZ_A1H", 00313 "NUCLEO_F091RC", "NUCLEO_F072RB", "NUCLEO_F042K6", "NUCLEO_F334R8", "NUCLEO_F207ZG", 00314 "NUCLEO_F303RE", "NUCLEO_F303K8", "NUCLEO_F302R8", "NUCLEO_F446RE","NUCLEO_F446ZE", 00315 "DISCO_F469NI", "DISCO_F429ZI", "NUCLEO_F103RB", "NUCLEO_F746ZG", 00316 "DISCO_F746NG", "DISCO_L476VG", "NUCLEO_L476RG", "NUCLEO_L432KC", 00317 "DISCO_F769NI", "NUCLEO_F767ZI", "DISCO_F303VC", "NUCLEO_F412ZG", 00318 "DISCO_F413ZH", "NUCLEO_F413ZH"] 00319 }, 00320 { 00321 "id": "MBED_A28", "description": "CAN loopback test", 00322 "source_dir": join(TEST_DIR, "mbed", "can_loopback"), 00323 "dependencies": [MBED_LIBRARIES, TEST_MBED_LIB], 00324 "automated": True, 00325 "mcu": ["B96B_F446VE", 00326 "NUCLEO_F091RC", "NUCLEO_F072RB", "NUCLEO_F042K6", "NUCLEO_F334R8", "NUCLEO_F207ZG", 00327 "NUCLEO_F303RE", "NUCLEO_F303K8", "NUCLEO_F302R8", "NUCLEO_F303ZE", "NUCLEO_F446RE","NUCLEO_F446ZE", 00328 "DISCO_F469NI", "DISCO_F429ZI", "NUCLEO_F103RB", "NUCLEO_F746ZG", 00329 00330 "DISCO_F746NG", "DISCO_L476VG", "NUCLEO_L476RG", "NUCLEO_L432KC", 00331 "DISCO_F769NI", "NUCLEO_F767ZI", "DISCO_F303VC", "NUCLEO_F412ZG", 00332 "DISCO_F413ZH", "NUCLEO_F413ZH"] 00333 }, 00334 { 00335 "id": "MBED_A29", "description": "i2c_master_slave_asynch", 00336 "source_dir": join(TEST_DIR, "mbed", "i2c_master_slave_asynch"), 00337 "dependencies": [MBED_LIBRARIES, TEST_MBED_LIB], 00338 "automated": True, 00339 "peripherals": ["i2c_loop"] 00340 }, 00341 { 00342 "id": "MBED_A30", "description": "CAN API", 00343 "source_dir": join(TEST_DIR, "mbed", "can_api"), 00344 "dependencies": [MBED_LIBRARIES, TEST_MBED_LIB], 00345 "automated": True, 00346 "mcu": ["LPC1549", "LPC1768","B96B_F446VE", "VK_RZ_A1H", 00347 "NUCLEO_F091RC", "NUCLEO_F072RB", "NUCLEO_F042K6", "NUCLEO_F334R8", "NUCLEO_F207ZG", 00348 "NUCLEO_F303RE", "NUCLEO_F303K8", "NUCLEO_F303ZE", "NUCLEO_F302R8", "NUCLEO_F446RE","NUCLEO_F446ZE", 00349 "DISCO_F469NI", "DISCO_F429ZI", "NUCLEO_F103RB", "NUCLEO_F746ZG", 00350 "NUCLEO_F429ZI", "NUCLEO_F439ZI", "NUCLEO_F756ZG", "NUCLEO_L486RG", 00351 "DISCO_F746NG", "DISCO_L476VG", "NUCLEO_L476RG", "NUCLEO_L432KC", 00352 "DISCO_F769NI", "NUCLEO_F767ZI", "DISCO_F303VC", "NUCLEO_F412ZG"] 00353 }, 00354 { 00355 "id": "MBED_BLINKY", "description": "Blinky", 00356 "source_dir": join(TEST_DIR, "mbed", "blinky"), 00357 "dependencies": [MBED_LIBRARIES, TEST_MBED_LIB], 00358 "automated": False, 00359 }, 00360 { 00361 "id": "MBED_BUS", "description": "Blinky BUS", 00362 "source_dir": join(TEST_DIR, "mbed", "bus"), 00363 "dependencies": [MBED_LIBRARIES, TEST_MBED_LIB], 00364 "automated": False, 00365 }, 00366 00367 { 00368 "id": "MBED_BUSOUT", "description": "BusOut", 00369 "source_dir": join(TEST_DIR, "mbed", "bus_out"), 00370 "dependencies": [MBED_LIBRARIES, TEST_MBED_LIB], 00371 "exclude_mcu": ["NUCLEO_L011K4"], 00372 "automated": True, 00373 }, 00374 00375 # Size benchmarks 00376 { 00377 "id": "BENCHMARK_1", "description": "Size (c environment)", 00378 "source_dir": join(BENCHMARKS_DIR, "cenv"), 00379 "dependencies": [MBED_LIBRARIES] 00380 }, 00381 { 00382 "id": "BENCHMARK_2", "description": "Size (float math)", 00383 "source_dir": join(BENCHMARKS_DIR, "float_math"), 00384 "dependencies": [MBED_LIBRARIES] 00385 }, 00386 { 00387 "id": "BENCHMARK_3", "description": "Size (printf)", 00388 "source_dir": join(BENCHMARKS_DIR, "printf"), 00389 "dependencies": [MBED_LIBRARIES] 00390 }, 00391 { 00392 "id": "BENCHMARK_4", "description": "Size (mbed libs)", 00393 "source_dir": join(BENCHMARKS_DIR, "mbed"), 00394 "dependencies": [MBED_LIBRARIES] 00395 }, 00396 { 00397 "id": "BENCHMARK_5", "description": "Size (all)", 00398 "source_dir": join(BENCHMARKS_DIR, "all"), 00399 "dependencies": [MBED_LIBRARIES] 00400 }, 00401 00402 00403 # Not automated MBED tests 00404 { 00405 "id": "MBED_1", "description": "I2C SRF08", 00406 "source_dir": join(TEST_DIR, "mbed", "i2c_SRF08"), 00407 "dependencies": [MBED_LIBRARIES, TEST_MBED_LIB, join(PERIPHERALS, 'SRF08')], 00408 "peripherals": ["SRF08"] 00409 }, 00410 { 00411 "id": "MBED_2", "description": "stdio", 00412 "source_dir": join(TEST_DIR, "mbed", "stdio"), 00413 "dependencies": [MBED_LIBRARIES, TEST_MBED_LIB], 00414 "automated": True, 00415 #"host_test": "stdio_auto" 00416 }, 00417 { 00418 "id": "MBED_3", "description": "PortOut", 00419 "source_dir": join(TEST_DIR, "mbed", "portout"), 00420 "dependencies": [MBED_LIBRARIES], 00421 }, 00422 { 00423 "id": "MBED_4", "description": "Sleep", 00424 "source_dir": join(TEST_DIR, "mbed", "sleep"), 00425 "dependencies": [MBED_LIBRARIES, TEST_MBED_LIB], 00426 "mcu": ["LPC1768", "LPC11U24", "LPC4088","LPC4088_DM","NRF51822", "LPC11U68"] 00427 }, 00428 { 00429 "id": "MBED_5", "description": "PWM", 00430 "source_dir": join(TEST_DIR, "mbed", "pwm"), 00431 "dependencies": [MBED_LIBRARIES, TEST_MBED_LIB] 00432 }, 00433 { 00434 "id": "MBED_6", "description": "SW Reset", 00435 "source_dir": join(TEST_DIR, "mbed", "reset"), 00436 "dependencies": [MBED_LIBRARIES], 00437 }, 00438 { 00439 "id": "MBED_7", "description": "stdio benchmark", 00440 "source_dir": join(TEST_DIR, "mbed", "stdio_benchmark"), 00441 "dependencies": [MBED_LIBRARIES], 00442 }, 00443 { 00444 "id": "MBED_8", "description": "SPI", 00445 "source_dir": join(TEST_DIR, "mbed", "spi"), 00446 "dependencies": [MBED_LIBRARIES], 00447 }, 00448 { 00449 "id": "MBED_9", "description": "Sleep Timeout", 00450 "source_dir": join(TEST_DIR, "mbed", "sleep_timeout"), 00451 "dependencies": [MBED_LIBRARIES], 00452 }, 00453 { 00454 "id": "MBED_10", "description": "Hello World", 00455 "source_dir": join(TEST_DIR, "mbed", "hello"), 00456 "dependencies": [MBED_LIBRARIES, TEST_MBED_LIB], 00457 "automated": True, 00458 #"host_test": "hello_auto", 00459 }, 00460 { 00461 "id": "MBED_11", "description": "Ticker Int", 00462 "source_dir": join(TEST_DIR, "mbed", "ticker"), 00463 "dependencies": [MBED_LIBRARIES, TEST_MBED_LIB], 00464 "automated": True, 00465 #"host_test": "wait_us_auto", 00466 }, 00467 { 00468 "id": "MBED_12", "description": "C++", 00469 "source_dir": join(TEST_DIR, "mbed", "cpp"), 00470 "dependencies": [MBED_LIBRARIES, TEST_MBED_LIB], 00471 "automated": True 00472 }, 00473 { 00474 "id": "MBED_13", "description": "Heap & Stack", 00475 "source_dir": join(TEST_DIR, "mbed", "heap_and_stack"), 00476 "dependencies": [MBED_LIBRARIES, TEST_MBED_LIB], 00477 }, 00478 { 00479 "id": "MBED_14", "description": "Serial Interrupt", 00480 "source_dir": join(TEST_DIR, "mbed", "serial_interrupt"), 00481 "dependencies": [MBED_LIBRARIES, TEST_MBED_LIB], 00482 }, 00483 { 00484 "id": "MBED_15", "description": "RPC", 00485 "source_dir": join(TEST_DIR, "mbed", "rpc"), 00486 "dependencies": [MBED_LIBRARIES, join(LIB_DIR, "rpc"), TEST_MBED_LIB], 00487 "automated": False, 00488 "mcu": ["LPC1768"] 00489 }, 00490 { 00491 "id": "MBED_16", "description": "RTC", 00492 "source_dir": join(TEST_DIR, "mbed", "rtc"), 00493 "dependencies": [MBED_LIBRARIES, TEST_MBED_LIB], 00494 "automated": True, 00495 "exclude_mcu": ["NRF51822", "NRF51822_BOOT", "NRF51822_OTA", "NRF51822_Y5_MBUG", 00496 "NRF51_DK", "NRF51_DK_BOOT", "NRF51_DK_OTA", 00497 "NRF51_MICROBIT", "NRF51_MICROBIT_B", "NRF51_MICROBIT_BOOT", 00498 "NRF51_MICROBIT_B_BOOT", "NRF51_MICROBIT_B_OTA", "NRF51_MICROBIT_OTA", 00499 "HRM1017", "HRM1017_BOOT", "HRM1701_OTA", 00500 "NUCLEO_L011K4", 00501 "TY51822R3", "TY51822R3_BOOT", "TY51822R3_OTA", 00502 "NRF15_DONGLE", "NRF15_DONGLE_BOOT", "NRF15_DONGLE_OTA", 00503 "ARCH_BLE", "ARCH_BLE_BOOT", "ARCH_BLE_OTA", 00504 "ARCH_LINK", "ARCH_LINK_BOOT", "ARCH_LINK_OTA", 00505 "RBLAB_BLENANO", "RBLAB_BLENANO_BOOT", "RBLAB_BLENANO_OTA", 00506 "RBLAB_NRF51822", "RBLAB_NRF51822_BOOT", "RBLAB_NRF51822_OTA", 00507 "SEEED_TINY_BLE", "SEEED_TINY_BLE_BOOT", "SEEED_TINY_BLE_OTA", 00508 "WALLBOT_BLE", "WALLBOT_BLE_BOOT", "WALLBOT_BLE_OTA", 00509 "DELTA_DFCM_NNN40", "DELTA_DFCM_NNN40_BOOT", "DELTA_DFCM_NNN40_OTA", 00510 "LPC1114"], 00511 #"host_test": "rtc_auto", 00512 }, 00513 { 00514 "id": "MBED_17", "description": "Serial Interrupt 2", 00515 "source_dir": join(TEST_DIR, "mbed", "serial_interrupt_2"), 00516 "dependencies": [MBED_LIBRARIES], 00517 }, 00518 { 00519 "id": "MBED_18", "description": "Local FS Directory", 00520 "source_dir": join(TEST_DIR, "mbed", "dir"), 00521 "dependencies": [MBED_LIBRARIES], 00522 }, 00523 { 00524 "id": "MBED_20", "description": "InterruptIn 2", 00525 "source_dir": join(TEST_DIR, "mbed", "interruptin_2"), 00526 "dependencies": [MBED_LIBRARIES], 00527 }, 00528 { 00529 "id": "MBED_21", "description": "freopen Stream", 00530 "source_dir": join(TEST_DIR, "mbed", "freopen"), 00531 "dependencies": [MBED_LIBRARIES], 00532 }, 00533 { 00534 "id": "MBED_22", "description": "Semihost", 00535 "source_dir": join(TEST_DIR, "mbed", "semihost"), 00536 "dependencies": [MBED_LIBRARIES, TEST_MBED_LIB], 00537 "automated": True, 00538 "mcu": ["LPC1768", "LPC11U24"] 00539 }, 00540 { 00541 "id": "MBED_23", "description": "Ticker Int us", 00542 "source_dir": join(TEST_DIR, "mbed", "ticker_2"), 00543 "dependencies": [MBED_LIBRARIES, TEST_MBED_LIB], 00544 "automated": True, 00545 #"host_test": "wait_us_auto" 00546 }, 00547 { 00548 "id": "MBED_24", "description": "Timeout Int us", 00549 "source_dir": join(TEST_DIR, "mbed", "timeout"), 00550 "dependencies": [MBED_LIBRARIES, TEST_MBED_LIB], 00551 "automated": True, 00552 #"host_test": "wait_us_auto" 00553 }, 00554 { 00555 "id": "MBED_25", "description": "Time us", 00556 "source_dir": join(TEST_DIR, "mbed", "time_us"), 00557 "dependencies": [MBED_LIBRARIES, TEST_MBED_LIB], 00558 "automated": True, 00559 #"host_test": "wait_us_auto" 00560 }, 00561 { 00562 "id": "MBED_26", "description": "Integer constant division", 00563 "source_dir": join(TEST_DIR, "mbed", "div"), 00564 "dependencies": [MBED_LIBRARIES, TEST_MBED_LIB], 00565 "automated": True, 00566 }, 00567 { 00568 "id": "MBED_27", "description": "SPI ADXL345", 00569 "source_dir": join(TEST_DIR, "mbed", "spi_ADXL345"), 00570 "dependencies": [MBED_LIBRARIES, TEST_MBED_LIB, join(PERIPHERALS, 'ADXL345')], 00571 "peripherals": ["ADXL345"] 00572 }, 00573 { 00574 "id": "MBED_28", "description": "Interrupt chaining (InterruptManager)", 00575 "source_dir": join(TEST_DIR, "mbed", "interrupt_chaining"), 00576 "dependencies": [MBED_LIBRARIES, TEST_MBED_LIB], 00577 }, 00578 { 00579 "id": "MBED_29", "description": "CAN network test", 00580 "source_dir": join(TEST_DIR, "mbed", "can"), 00581 "dependencies": [MBED_LIBRARIES], 00582 "mcu": ["LPC1768", "LPC4088", "LPC1549", "RZ_A1H", "GR_LYCHEE", "B96B_F446VE", "NUCLEO_F091RC", 00583 "NUCLEO_F072RB", "NUCLEO_F042K6", "NUCLEO_F334R8", "NUCLEO_F303RE", 00584 "NUCLEO_F303K8", "NUCLEO_F302R8", "NUCLEO_F446RE","NUCLEO_F446ZE", "DISCO_F469NI", "NUCLEO_F207ZG", 00585 "DISCO_F429ZI", "NUCLEO_F103RB", "NUCLEO_F746ZG", "DISCO_F746NG", 00586 "NUCLEO_L476RG", "NUCLEO_L432KC", "DISCO_F303VC", "NUCLEO_F412ZG", 00587 "DISCO_F413ZH", "NUCLEO_F413ZH"] 00588 }, 00589 { 00590 "id": "MBED_30", "description": "CAN network test using interrupts", 00591 "source_dir": join(TEST_DIR, "mbed", "can_interrupt"), 00592 "dependencies": [MBED_LIBRARIES], 00593 "mcu": ["LPC1768", "LPC4088", "LPC1549", "RZ_A1H", "GR_LYCHEE", "B96B_F446VE", "NUCLEO_F091RC", "NUCLEO_F207ZG", 00594 "NUCLEO_F072RB", "NUCLEO_F042K6", "NUCLEO_F334R8", "NUCLEO_F303RE", 00595 "NUCLEO_F303K8", "NUCLEO_F302R8", "NUCLEO_F446RE", "NUCLEO_F446ZE", "DISCO_F469NI", 00596 "DISCO_F429ZI", "NUCLEO_F103RB", "NUCLEO_F746ZG", "DISCO_F746NG", 00597 "NUCLEO_L476RG", "NUCLEO_L432KC", "DISCO_F303VC", "NUCLEO_F412ZG", 00598 "DISCO_F413ZH", "NUCLEO_F413ZH"] 00599 }, 00600 { 00601 "id": "MBED_31", "description": "PWM LED test", 00602 "source_dir": join(TEST_DIR, "mbed", "pwm_led"), 00603 "dependencies": [MBED_LIBRARIES], 00604 }, 00605 { 00606 "id": "MBED_32", "description": "Pin toggling", 00607 "source_dir": join(TEST_DIR, "mbed", "pin_toggling"), 00608 "dependencies": [MBED_LIBRARIES], 00609 }, 00610 { 00611 "id": "MBED_33", "description": "C string operations", 00612 "source_dir": join(TEST_DIR, "mbed", "cstring"), 00613 "dependencies": [MBED_LIBRARIES, TEST_MBED_LIB], 00614 "automated": False, 00615 }, 00616 { 00617 "id": "MBED_34", "description": "Ticker Two callbacks", 00618 "source_dir": join(TEST_DIR, "mbed", "ticker_3"), 00619 "dependencies": [MBED_LIBRARIES, TEST_MBED_LIB], 00620 "automated": True, 00621 #"host_test": "wait_us_auto" 00622 }, 00623 { 00624 "id": "MBED_35", "description": "SPI C12832 display", 00625 "source_dir": join(TEST_DIR, "mbed", "spi_C12832"), 00626 "dependencies": [MBED_LIBRARIES, TEST_MBED_LIB, join(PERIPHERALS, 'C12832')], 00627 "peripherals": ["C12832"], 00628 "automated": True, 00629 }, 00630 { 00631 "id": "MBED_36", "description": "WFI correct behavior", 00632 "source_dir": join(TEST_DIR, "mbed", "wfi"), 00633 "dependencies": [MBED_LIBRARIES, TEST_MBED_LIB], 00634 "automated": False 00635 }, 00636 { 00637 "id": "MBED_37", "description": "Serial NC RX", 00638 "source_dir": join(TEST_DIR, "mbed", "serial_nc_rx"), 00639 "dependencies": [MBED_LIBRARIES, TEST_MBED_LIB], 00640 "exclude_mcu": ["NUCLEO_L011K4"], 00641 "automated": True 00642 }, 00643 { 00644 "id": "MBED_38", "description": "Serial NC TX", 00645 "source_dir": join(TEST_DIR, "mbed", "serial_nc_tx"), 00646 "dependencies": [MBED_LIBRARIES, TEST_MBED_LIB], 00647 "exclude_mcu": ["NUCLEO_L011K4"], 00648 "automated": True 00649 }, 00650 { 00651 "id": "MBED_39", "description": "Serial Complete", 00652 "source_dir": join(TEST_DIR, "mbed", "serial_complete"), 00653 "dependencies": [MBED_LIBRARIES, TEST_MBED_LIB], 00654 "automated": False 00655 }, 00656 00657 # USB Tests 00658 # USB device test list 00659 { 00660 "id": "USB_1", "description": "Mouse", 00661 "source_dir": join(TEST_DIR, "usb", "device", "basic"), 00662 "dependencies": [MBED_LIBRARIES, USB_LIBRARIES], 00663 }, 00664 { 00665 "id": "USB_2", "description": "Keyboard", 00666 "source_dir": join(TEST_DIR, "usb", "device", "keyboard"), 00667 "dependencies": [MBED_LIBRARIES, USB_LIBRARIES], 00668 }, 00669 { 00670 "id": "USB_3", "description": "Mouse_Keyboard", 00671 "source_dir": join(TEST_DIR, "usb", "device", "keyboard"), 00672 "dependencies": [MBED_LIBRARIES, USB_LIBRARIES], 00673 }, 00674 { 00675 "id": "USB_4", "description": "Serial Port", 00676 "source_dir": join(TEST_DIR, "usb", "device", "serial"), 00677 "dependencies": [MBED_LIBRARIES, USB_LIBRARIES], 00678 }, 00679 { 00680 "id": "USB_5", "description": "Generic HID", 00681 "source_dir": join(TEST_DIR, "usb", "device", "raw_hid"), 00682 "dependencies": [MBED_LIBRARIES, USB_LIBRARIES], 00683 }, 00684 { 00685 "id": "USB_6", "description": "MIDI", 00686 "source_dir": join(TEST_DIR, "usb", "device", "midi"), 00687 "dependencies": [MBED_LIBRARIES, USB_LIBRARIES], 00688 }, 00689 { 00690 "id": "USB_7", "description": "AUDIO", 00691 "source_dir": join(TEST_DIR, "usb", "device", "audio"), 00692 "dependencies": [MBED_LIBRARIES, USB_LIBRARIES], 00693 }, 00694 { 00695 "id": "USB_8", "description": "AUDIO_CB", 00696 "source_dir": join(TEST_DIR, "usb", "device", "audio_cb"), 00697 "dependencies": [MBED_LIBRARIES, USB_LIBRARIES], 00698 }, 00699 00700 # CMSIS DSP 00701 { 00702 "id": "CMSIS_DSP_1", "description": "FIR", 00703 "source_dir": join(TEST_DIR, "dsp", "cmsis", "fir_f32"), 00704 "dependencies": [MBED_LIBRARIES, DSP_LIBRARIES], 00705 }, 00706 00707 # mbed DSP 00708 { 00709 "id": "DSP_1", "description": "FIR", 00710 "source_dir": join(TEST_DIR, "dsp", "mbed", "fir_f32"), 00711 "dependencies": [MBED_LIBRARIES, DSP_LIBRARIES], 00712 }, 00713 00714 # KL25Z 00715 { 00716 "id": "KL25Z_1", "description": "LPTMR", 00717 "source_dir": join(TEST_DIR, "KL25Z", "lptmr"), 00718 "dependencies": [MBED_LIBRARIES], 00719 "supported": CORTEX_ARM_SUPPORT, 00720 "mcu": ["KL25Z"], 00721 }, 00722 { 00723 "id": "KL25Z_2", "description": "PIT", 00724 "source_dir": join(TEST_DIR, "KL25Z", "pit"), 00725 "dependencies": [MBED_LIBRARIES], 00726 "supported": CORTEX_ARM_SUPPORT, 00727 "mcu": ["KL25Z"], 00728 }, 00729 { 00730 "id": "KL25Z_3", "description": "TSI Touch Sensor", 00731 "source_dir": join(TEST_DIR, "mbed", "tsi"), 00732 "dependencies": [MBED_LIBRARIES, TEST_MBED_LIB, join(PERIPHERALS, 'TSI')], 00733 "mcu": ["KL25Z"], 00734 }, 00735 { 00736 "id": "KL25Z_4", "description": "RTC", 00737 "source_dir": join(TEST_DIR, "KL25Z", "rtc"), 00738 "dependencies": [MBED_LIBRARIES], 00739 "mcu": ["KL25Z"], 00740 }, 00741 { 00742 "id": "KL25Z_5", "description": "MMA8451Q accelerometer", 00743 "source_dir": join(TEST_DIR, "mbed", "i2c_MMA8451Q"), 00744 "dependencies": [MBED_LIBRARIES, TEST_MBED_LIB, join(PERIPHERALS, 'MMA8451Q')], 00745 "mcu": ["KL25Z", "KL05Z", "KL46Z", "K20D50M"], 00746 "automated": True, 00747 }, 00748 00749 # Examples 00750 { 00751 "id": "EXAMPLE_1", "description": "/dev/null", 00752 "source_dir": join(TEST_DIR, "mbed", "dev_null"), 00753 "dependencies": [MBED_LIBRARIES, TEST_MBED_LIB], 00754 "exclude_mcu": ["NUCLEO_L011K4"], 00755 "automated": True, 00756 #"host_test" : "dev_null_auto", 00757 }, 00758 00759 # CPPUTEST Library provides Unit testing Framework 00760 # 00761 # To write TESTs and TEST_GROUPs please add CPPUTEST_LIBRARY to 'dependencies' 00762 # 00763 # This will also include: 00764 # 1. test runner - main function with call to CommandLineTestRunner::RunAllTests(ac, av) 00765 # 2. Serial console object to print test result on serial port console 00766 # 00767 00768 # Unit testing with cpputest library 00769 { 00770 "id": "UT_1", "description": "Basic", 00771 "source_dir": join(TEST_DIR, "utest", "basic"), 00772 "dependencies": [MBED_LIBRARIES, TEST_MBED_LIB, CPPUTEST_LIBRARY], 00773 "automated": False, 00774 }, 00775 { 00776 "id": "UT_2", "description": "Semihost file system", 00777 "source_dir": join(TEST_DIR, "utest", "semihost_fs"), 00778 "dependencies": [MBED_LIBRARIES, TEST_MBED_LIB, CPPUTEST_LIBRARY], 00779 "automated": False, 00780 "mcu": ["LPC1768", "LPC11U24"] 00781 }, 00782 { 00783 "id": "UT_3", "description": "General tests", 00784 "source_dir": join(TEST_DIR, "utest", "general"), 00785 "dependencies": [MBED_LIBRARIES, TEST_MBED_LIB, CPPUTEST_LIBRARY], 00786 "automated": False, 00787 }, 00788 { 00789 "id": "UT_BUSIO", "description": "BusIn BusOut", 00790 "source_dir": join(TEST_DIR, "utest", "bus"), 00791 "dependencies": [MBED_LIBRARIES, TEST_MBED_LIB, CPPUTEST_LIBRARY], 00792 "automated": False, 00793 }, 00794 { 00795 "id": "UT_I2C_EEPROM_ASYNCH", "description": "I2C Asynch eeprom", 00796 "source_dir": join(TEST_DIR, "utest", "i2c_eeprom_asynch"), 00797 "dependencies": [MBED_LIBRARIES, TEST_MBED_LIB, CPPUTEST_LIBRARY], 00798 "automated": False, 00799 }, 00800 { 00801 "id": "UT_SERIAL_ASYNCH", "description": "Asynch serial test (req 2 serial peripherals)", 00802 "source_dir": join(TEST_DIR, "utest", "serial_asynch"), 00803 "dependencies": [MBED_LIBRARIES, TEST_MBED_LIB, CPPUTEST_LIBRARY], 00804 "automated": False, 00805 }, 00806 { 00807 "id": "UT_SPI_ASYNCH", "description": "Asynch spi test", 00808 "source_dir": join(TEST_DIR, "utest", "spi_asynch"), 00809 "dependencies": [MBED_LIBRARIES, TEST_MBED_LIB, CPPUTEST_LIBRARY], 00810 "automated": False, 00811 }, 00812 { 00813 "id": "UT_LP_TICKER", "description": "Low power ticker test", 00814 "source_dir": join(TEST_DIR, "utest", "lp_ticker"), 00815 "dependencies": [MBED_LIBRARIES, TEST_MBED_LIB, CPPUTEST_LIBRARY], 00816 "automated": False, 00817 }, 00818 00819 # Tests used for target information purposes 00820 { 00821 "id": "DTCT_1", "description": "Simple detect test", 00822 "source_dir": join(TEST_DIR, "mbed", "detect"), 00823 "dependencies": [MBED_LIBRARIES, TEST_MBED_LIB], 00824 "automated": True, 00825 #"host_test" : "detect_auto", 00826 }, 00827 00828 ] 00829 00830 # Group tests with the same goals into categories 00831 GROUPS = { 00832 "core": ["MBED_A1", "MBED_A2", "MBED_A3", "MBED_A18"], 00833 "digital_io": ["MBED_A5", "MBED_A6", "MBED_A7", "MBED_A10", "MBED_A11"], 00834 "analog_io": ["MBED_A8"], 00835 "i2c": ["MBED_A19", "MBED_A20"], 00836 "spi": ["MBED_A12"], 00837 } 00838 00839 GROUPS["automated"] = [test["id"] for test in TESTS if test.get("automated", False)] 00840 # Look for 'TEST_GROUPS' in mbed_settings.py and update the GROUPS dictionary 00841 # with the information in test_groups if found 00842 try: 00843 from mbed_settings import TEST_GROUPS 00844 except: 00845 TEST_GROUPS = {} 00846 GROUPS.update(TEST_GROUPS) 00847 00848 class Test: 00849 DEFAULTS = { 00850 #'mcu': None, 00851 'description': None, 00852 'dependencies': None, 00853 'duration': 30, 00854 'host_test': 'host_test', 00855 'automated': False, 00856 'peripherals': None, 00857 #'supported': None, 00858 'source_dir': None, 00859 'extra_files': None 00860 } 00861 def __init__(self, n): 00862 self.n = n 00863 self.__dict__.update(Test.DEFAULTS) 00864 self.__dict__.update(TESTS[n]) 00865 00866 def is_supported(self, target, toolchain): 00867 if hasattr(self, 'mcu') and not target in self.mcu: 00868 return False 00869 if hasattr(self, 'exclude_mcu') and target in self.exclude_mcu: 00870 return False 00871 if not hasattr(self, 'supported'): 00872 return True 00873 return (target in self.supported) and (toolchain in self.supported[target]) 00874 00875 def get_description(self): 00876 if self.description: 00877 return self.description 00878 else: 00879 return self.id 00880 00881 def __cmp__(self, other): 00882 return cmp(self.n, other.n) 00883 00884 def __str__(self): 00885 return "[%3d] %s: %s" % (self.n, self.id, self.get_description()) 00886 00887 def __getitem__(self, key): 00888 if key == "id": return self.id 00889 elif key == "mcu": return self.mcu 00890 elif key == "exclude_mcu": return self.exclude_mcu 00891 elif key == "dependencies": return self.dependencies 00892 elif key == "description": return self.description 00893 elif key == "duration": return self.duration 00894 elif key == "host_test": return self.host_test 00895 elif key == "automated": return self.automated 00896 elif key == "peripherals": return self.peripherals 00897 elif key == "supported": return self.supported 00898 elif key == "source_dir": return self.source_dir 00899 elif key == "extra_files": return self.extra_files 00900 else: 00901 return None 00902 00903 TEST_MAP = dict([(test['id'], Test(i)) for i, test in enumerate(TESTS)]) 00904 00905 # parser helpers 00906 def test_known(string): 00907 i = int(string) 00908 if i >= 0 and i < len(TESTS): 00909 return i 00910 else: 00911 raise ArgumentTypeError("{0} does not index a test. The accepted range is 0 to {1}\nThe test mapping is:\n{2}".format(i, len(TEST_MAP) - 1, columnate([str(i) + ":" + t['id'] for i,t in zip(range(len(TESTS)), TESTS)]))) 00912 00913 def test_name_known(string): 00914 if string not in TEST_MAP.keys(): 00915 raise ArgumentTypeError("Program with name '{0}' not found. Supported tests are: \n{1}".format(string, columnate([t['id'] for t in TESTS]))) 00916 00917 return TEST_MAP[string].n
Generated on Tue Jul 12 2022 14:24:41 by
