UtestRunner

Utest automated test robot | utest 自动化测试机器人

APACHE-2.0 License

Stars
8

Utest

what

utest RT-Thread Runner utest CI

why

utest qemu

how

1. QEMU

STEP1 BSP

BSP Scons bin elf

STEP2

  • python3
  • scons
  • qemu-system-arm

CI

  • Github Action
  • Travis CI

STEP3 QEMU

QEMU qemu_runner.py help

python qemu_runner.py --help
usage: qemu_runner.py [-h] --elf path --sd path [--delay seconds]

QEMU runner for RT-Thread utest

optional arguments:
  -h, --help       show this help message and exit
  --elf path       elf file path for running QEMU
  --sd path        SD filesystem binary file for QEMU
  --delay seconds  delay some seconds for QEMU running finish

BSP elf QEMU sd.bin

D:\Program\Python\UtestQemuRunner>python qemu_runner.py --elf D:/Program/RTT/rt-thread/bsp/qemu-vexpress-a9/Debug/rtthread.elf --sd D:/Program/RTT/rt-thread/bsp/qemu-vexpress-a9/sd.bin
2020-02-04 23:07:29,686 qemu_runner INFO: QEMU environment check OK.
2020-02-04 23:07:29,687 qemu_runner DEBUG: QEMU emulator version 3.0.0 (v3.0.0-11723-ge2ddcc5879-dirty)
Copyright (c) 2003-2017 Fabrice Bellard and the QEMU Project developers

WARNING: Image format was not specified for 'D:/Program/RTT/rt-thread/bsp/qemu-vexpress-a9/sd.bin' and probing guessed raw.
         Automatically detecting the format is dangerous for raw images, write operations on block 0 will be restricted.
         Specify the 'raw' format explicitly to remove the restrictions.
2020-02-04 23:07:35,717 utest DEBUG: Get a testcase: packages.tools.easyflash, timeout: 20
2020-02-04 23:07:35,717 utest INFO: Start test: packages.tools.easyflash
2020-02-04 23:07:46,016 utest INFO: Test passed
2020-02-04 23:07:46,519 qemu_runner INFO: QEMU runner destroy

D:\Program\Python\UtestQemuRunner>

2.

STEP1 BSP

BSP Scons bin elf

STEP2

  • python3
  • scons
  • pyserial
  • pyserial-asyncio

CI

STEP3 Serial

Serial serial _runner.py help

python .\serial_runner.py --help
usage: serial_runner.py [-h] [--port port] [--baudrate bps] [--delay seconds]

serial runner for RT-Thread utest

options:
  -h, --help       show this help message and exit
  --port port      port for serial
  --baudrate bps   baudrate for serial
  --delay seconds  delay some seconds for serial running finish

BSP elf

python.exe .\serial_runner.py --port=com16 --baudrate=115200
2023-07-04 12:04:25,289 asyncio DEBUG: Using proactor: IocpProactor
2023-07-04 12:04:31,419 utest DEBUG: Get a testcase: testcases.utest.pass_tc, timeout: 10
2023-07-04 12:04:31,420 utest INFO: Start test: testcases.utest.pass_tc
2023-07-04 12:04:32,552 utest INFO: Test passed
2023-07-04 12:04:32,552 serial_runner INFO: serial runner destroy