pico-tracker/firmware/test
Richard Meadows 9008a2f5c5 Renamed test case main to avoid clash with other main.c, always rebuild source for testcases, show full debug trace during testcases (keepin' it real) 2015-06-15 11:29:43 +01:00
..
ctypesgen Plenty of changes to the test system 2015-03-13 19:28:09 +00:00
tc Added basic testcase for aprs geofence 2015-06-07 22:22:24 +01:00
README.md Brought test case readme up to date 2015-06-15 11:20:15 +01:00
tests.py Testcases now run through prelude 2015-03-13 19:42:01 +00:00
tmain.c Renamed test case main to avoid clash with other main.c, always rebuild source for testcases, show full debug trace during testcases (keepin' it real) 2015-06-15 11:29:43 +01:00

README.md

Verification

Setup

sudo apt-get install python-pip
sudo pip install colorama

Usage

Something like this.

> /dev/null arm-none-eabi-gdb -q -x tools/tests.py

You need to have your debugger configured in config.mk and possibly also have gdbscript-custom. The test driver just issues an attach 1 command after gdb startup and expects that to work.

Operation

Initially tests.py loads the latest binary, and runs Reset_Handler until the top of main. It then jumps to tc_main instead.

While stopped in tc_main a pointer to the test case is set. The program is then run, and one loop of tc_main runs the test case.

Writing a new test case

  • Choose a testcase name [tc-name]
  • Create tc/[tc-name].py and tc/[tc_name].h. Use a pre-existing test case as a template.
  • Add #include [tc-name].h to the section at the top of main.c

You'll need to fill in the /* Parameters In */ and /* Results Out */ structures in tc/[tc-name].h

tc/[tc-name].py must contain a class called [tc-name]_tc that defines get_test and is_correct methods.