From ce81b01eda0f9e833bbb717e6f2cebad0030afa1 Mon Sep 17 00:00:00 2001 From: hathach Date: Mon, 20 Apr 2026 16:44:25 +0700 Subject: improving transfer tracking and adding support for un-armed Rx data handling --- test/hil/tinyusb.json | 3 +++ 1 file changed, 3 insertions(+) (limited to 'test/hil/tinyusb.json') diff --git a/test/hil/tinyusb.json b/test/hil/tinyusb.json index 92b7b21b0..5466cd534 100644 --- a/test/hil/tinyusb.json +++ b/test/hil/tinyusb.json @@ -226,6 +226,9 @@ { "name": "stm32f072disco", "uid": "3A001A001357364230353532", + "tests": { + "device": true, "host": false, "dual": false + }, "flasher": { "name": "jlink", "uid": "779541626", -- cgit v1.3.1 From 3792a9a3871cad32d7f38bc831417f60aeb17aff Mon Sep 17 00:00:00 2001 From: hathach Date: Sun, 26 Apr 2026 23:15:49 +0700 Subject: fix warning, change hil jlink for feather nrf52840 --- examples/device/cdc_msc_throughput/src/main.c | 6 +++--- test/hil/hil_test.py | 3 ++- test/hil/tinyusb.json | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) (limited to 'test/hil/tinyusb.json') diff --git a/examples/device/cdc_msc_throughput/src/main.c b/examples/device/cdc_msc_throughput/src/main.c index b6a0705a3..116cbe13f 100644 --- a/examples/device/cdc_msc_throughput/src/main.c +++ b/examples/device/cdc_msc_throughput/src/main.c @@ -99,9 +99,9 @@ void tud_msc_inquiry_cb(uint8_t lun, uint8_t vendor_id[8], uint8_t product_id[16 const char vid[] = "TinyUSB"; const char pid[] = "Mass Storage"; const char rev[] = "1.0"; - memcpy(vendor_id, vid, strlen(vid)); - memcpy(product_id, pid, strlen(pid)); - memcpy(product_rev, rev, strlen(rev)); + (void) strncpy((char*) vendor_id, vid, 8); + (void) strncpy((char*) product_id, pid, 16); + (void) strncpy((char*) product_rev, rev, 4); } bool tud_msc_test_unit_ready_cb(uint8_t lun) { diff --git a/test/hil/hil_test.py b/test/hil/hil_test.py index 7d716e339..9b4a36c1c 100755 --- a/test/hil/hil_test.py +++ b/test/hil/hil_test.py @@ -782,7 +782,8 @@ def test_device_cdc_msc_throughput(board): pass # Put tty in raw mode so dd sees pure binary throughput. - run_cmd(f'stty -F {tty} raw -echo') + rs = run_cmd(f'timeout 30 stty -F {tty} raw -echo') + assert rs.returncode == 0, f'stty failed: {rs.stdout.decode()}' # Payload aim: ~5 s per direction at FS (~830 kB/s), much less at HS. msc_count = 2 if is_fs else 16 # bs=1M diff --git a/test/hil/tinyusb.json b/test/hil/tinyusb.json index 5466cd534..e7cd435fa 100644 --- a/test/hil/tinyusb.json +++ b/test/hil/tinyusb.json @@ -43,7 +43,7 @@ }, "flasher": { "name": "jlink", - "uid": "000682804350", + "uid": "681295394", "args": "-device nrf52840_xxaa" } }, -- cgit v1.3.1 From f2654a675b67b0b83337dd4df13afd498c3a0809 Mon Sep 17 00:00:00 2001 From: hathach Date: Tue, 28 Apr 2026 16:50:44 +0700 Subject: only re-run tests that failed per board hil remove hub from pico2 since it is not stable --- test/hil/hil_test.py | 30 ++++++++++++++++++++++++------ test/hil/tinyusb.json | 5 ----- 2 files changed, 24 insertions(+), 11 deletions(-) (limited to 'test/hil/tinyusb.json') diff --git a/test/hil/hil_test.py b/test/hil/hil_test.py index 9b4a36c1c..e98bd5da7 100755 --- a/test/hil/hil_test.py +++ b/test/hil/hil_test.py @@ -58,6 +58,7 @@ STATUS_SKIPPED = "\033[33mSkipped\033[0m" verbose = False test_only = [] +board_test = {} build_dir = 'cmake-build' skip_flash = False @@ -1346,7 +1347,9 @@ def test_board(board): # default to all tests test_list = [] - if len(test_only) > 0: + if name in board_test: + test_list = board_test[name] + elif len(test_only) > 0: test_list = test_only else: if 'tests' in board: @@ -1366,19 +1369,23 @@ def test_board(board): print(f'{name:25} {skip:30} ... Skip') err_count = 0 + failed_tests = [] flags_on_list = [""] if 'build' in board and 'flags_on' in board['build']: flags_on_list = board['build']['flags_on'] for f1 in flags_on_list: for test in test_list: - err_count += test_example(board, f1, test) + ec = test_example(board, f1, test) + err_count += ec + if ec > 0: + failed_tests.append(test) # flash board_test last to disable board's usb (skipped when --skip-flash is set) if not skip_flash: test_example(board, flags_on_list[0], 'device/board_test') - return name, err_count + return name, err_count, sorted(set(failed_tests)) def main(): @@ -1387,6 +1394,7 @@ def main(): """ global verbose global test_only + global board_test global build_dir global max_retry global skip_flash @@ -1399,6 +1407,8 @@ def main(): parser.add_argument('-s', '--skip-board', action='append', default=[], help='Skip boards from test') parser.add_argument('-sf', '--skip-flash', action='store_true', help='Run tests without flashing firmware (use whatever is already on the board)') parser.add_argument('-t', '--test-only', action='append', default=[], help='Tests to run, all if not specified') + parser.add_argument('-bt', '--board-test', action='append', default=[], + help='Per-board test list as BOARD:test1,test2 (overrides -t for that board); repeat for multiple boards') parser.add_argument('-B', '--build-dir', default='cmake-build', help='Build folder name (default: cmake-build)') parser.add_argument('--build', action='store_true', help='Build firmware for selected boards with cmake before running tests') parser.add_argument('-r', '--retry', type=int, default=3, help='Retry count for failed tests (default: 3)') @@ -1410,6 +1420,11 @@ def main(): skip_boards = args.skip_board verbose = args.verbose test_only = args.test_only + for entry in args.board_test: + bname, _, tnames = entry.partition(':') + if not bname or not tnames: + parser.error(f'invalid --board-test value: {entry!r} (expected BOARD:test1,test2)') + board_test[bname] = [t for t in tnames.split(',') if t] build_dir = args.build_dir max_retry = args.retry skip_flash = args.skip_flash @@ -1443,12 +1458,15 @@ def main(): with Pool(processes=os.cpu_count()) as pool: mret = pool.map(test_board, config_boards) err_count = build_err + sum(e[1] for e in mret) - # generate skip list for next re-run if failed + # generate skip list for next re-run if failed: skip boards that fully passed, + # and emit -bt BOARD:t1,t2 so each failed board only re-runs its own failed tests. skip_fname = f'{config_file}.skip' if err_count > 0: - skip_boards += [name for name, err in mret if err == 0] + skip_boards += [name for name, err, _ in mret if err == 0] + parts = [f'--skip-board {i}' for i in skip_boards] + parts += [f'-bt {name}:{",".join(fts)}' for name, err, fts in mret if err > 0 and fts] with open(skip_fname, 'w') as f: - f.write(' '.join(f'--skip-board {i}' for i in skip_boards)) + f.write(' '.join(parts)) elif os.path.exists(skip_fname): os.remove(skip_fname) diff --git a/test/hil/tinyusb.json b/test/hil/tinyusb.json index e7cd435fa..a3f7ff8bf 100644 --- a/test/hil/tinyusb.json +++ b/test/hil/tinyusb.json @@ -183,11 +183,6 @@ "tests": { "device": false, "host": true, "dual": false, "dev_attached": [ - { - "vid_pid": "1a86_55d4", - "serial": "52D2002694", - "is_cdc": true - }, { "vid_pid": "0951_1603", "serial": "820000000000000045B46338", -- cgit v1.3.1