pico-tracker/firmware/test
Richard Meadows cde21d13f9 Added solar to adc, adc now runs on interrupt, added test case. TODO adc paramter tuning 2015-07-03 12:46:33 +01:00
..
ctypesgen
tc Added solar to adc, adc now runs on interrupt, added test case. TODO adc paramter tuning 2015-07-03 12:46:33 +01:00
template Added makefile for making new tcs 2015-06-28 19:13:15 +01:00
Makefile Added tests for memory, new test make now adds #inlcude to tmain.c 2015-06-28 20:06:45 +01:00
README.md Added tests for memory, new test make now adds #inlcude to tmain.c 2015-06-28 20:06:45 +01:00
tests.py Added a new test case that allows us to plot points processed on the ARM CM0+ back in the ipython notebook 2015-06-29 22:06:58 +01:00
tmain.c Added solar to adc, adc now runs on interrupt, added test case. TODO adc paramter tuning 2015-07-03 12:46:33 +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.

From the makefile

From the main firmware makefile you can just run

make test

to run all tests, or

make test tc=<tc name>

to run a specific test case. To get extra debug info

make test tc=<tc name> tc-gdb-info=1

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

From this directory you can just run 'make name=<new_name>'
  • 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 tmain.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.