esp-open-rtos/tests
sheinz e443655e7f Travis running tests on remote servers.
Extend test_runner.py to flash using esptool.py
2016-11-01 00:02:35 +02:00
..
cases Merge branch 'master' into feature/testing 2016-10-26 16:37:23 +03:00
fs-test@e531bc0d4f Moved spiff test to a test case. Reset retries in test runner 2016-10-24 21:47:29 +03:00
include Fix running dual test. Add basic wifi test 2016-10-24 19:44:22 +03:00
unity@bbf2fe3a93 Get testing system by projectgus working with master HEAD 2016-10-21 22:45:51 +03:00
Makefile Moved spiff test to a test case. Reset retries in test runner 2016-10-24 21:47:29 +03:00
README.md Travis running tests on remote servers. 2016-11-01 00:02:35 +02:00
test_main.c Code clean-up 2016-10-25 17:52:15 +03:00
test_runner.py Travis running tests on remote servers. 2016-11-01 00:02:35 +02:00

esp-open-rtos tests

Testing is based on Unity C testing framework.

Features

  • Single device test case.
  • Dual devices test cases. Run test case on two ESP8266 modules simultaneously.
  • Run only specified test cases.
  • List available test cases on a device.

Usage

There's a test runner script test_runner.py written in Python3 that runs test cases on ESP8266 connected to a host.

Requirements and dependencies

  • Python3 version > 3.4 sudo apt-get install python3 python3-pip
  • pyserial sudo pip3 install pyserial
  • ESP8266 board with reset to boot mode support
  • Two ESP8266 for dual mode test cases

Test runner is heavily relying on device reset using DTR and RTS signals. Popular ESP8266 boards such as NodeMcu and Wemos D1 support device reset into flash mode.

Options

--type or -t - Type of test case to run. Can be 'solo' or 'dual'. If not specified 'solo' test will be run.

--aport or -a - Serial port for device A. If not specified device /dev/ttyUSB0 is used.

--bport or -b - Serial port for device B. If not specified device /dev/ttyUSB1 is used.

--no-flash or -n - Do not flash the test firmware before running tests.

--flash or -f - Flash device directly with esptool instead of using make flash command. Can be used to flash binaries without esp-open-rtos environment.

--flash-cmd or -c - Flash command for esptool. Used together with --flash.

--list or -l - Display list of the available test cases on the device.

Example

Build test firmware, flash it using serial device /dev/tty.wchusbserial1410 and run only solo test cases:

./test_runner.py -a /dev/tty.wchusbserial1410

Build test firmware. Flash both devices as -t dual is specified. And run both solo and dual test cases:

./test_runner.py -a /dev/tty.wchusbserial1410 -b /dev/tty.wchusbserial1420 -t dual

Do not flash the firmware, only display available test cases on the device:

./test_runner.py -a /dev/tty.wchusbserial1410 -n -l

Do not flash the firmware and run only 2 and 4 test cases:

./test_runner.py -a /dev/tty.wchusbserial1410 -n 2 4

References

Unity - Simple Unit Testing for C