WellDone / MoMo-Firmware

Embedded PIC Firmware and hardware designs for the WellDone Mobile Monitor (MoMo).
welldone.org
Other
8 stars 6 forks source link

Unit Testing Support for pic24 #126

Closed timburke closed 10 years ago

timburke commented 10 years ago

This is the current unit testing support for pic24. To use it *you first need to install( the python package pycparser

pycparser is used to build the test runners for the unit tests. Unit tests are built for pic24 shared library only to test the functionality. Do:

> cd momo_modules/shared/pic24
> momo build test
scons: Reading SConscript files ...
scons: done reading SConscript files.
scons: Building targets ...
Compiling test/test_linkedlist.c
Compiling src/util/linkedlist.c
Compiling /home/timburke/src/welldone/MoMo-Firmware/momo_modules/test/pic24/unity/unity.c
Creating test runner
Compiling build/test/24f16ka101/test_linkedlist/objects/main.c
Linking build/test/24f16ka101/test_linkedlist/objects/test_linkedlist.elf
Running unit test
Processing log file
Compiling test/test_linkedlist.c
Compiling src/util/linkedlist.c
Compiling /home/timburke/src/welldone/MoMo-Firmware/momo_modules/test/pic24/unity/unity.c
Creating test runner
Compiling build/test/24fj64ga306/test_linkedlist/objects/main.c
Linking build/test/24fj64ga306/test_linkedlist/objects/test_linkedlist.elf
Running unit test
Processing log file
Compiling test/test_rpc_queue.c
Compiling src/mib/rpc_queue.c
Compiling src/core/task_manager.c
Compiling /home/timburke/src/welldone/MoMo-Firmware/momo_modules/shared/portable/util/ringbuffer.c
Compiling src/util/interrupts.c
Compiling /home/timburke/src/welldone/MoMo-Firmware/momo_modules/test/pic24/unity/unity.c
Creating test runner
Compiling build/test/24f16ka101/test_rpc_queue/objects/main.c
Linking build/test/24f16ka101/test_rpc_queue/objects/test_rpc_queue.elf
Running unit test
Processing log file
Compiling test/test_rpc_queue.c
Compiling src/mib/rpc_queue.c
Compiling src/core/task_manager.c
Compiling /home/timburke/src/welldone/MoMo-Firmware/momo_modules/shared/portable/util/ringbuffer.c
Compiling src/util/interrupts.c
Compiling /home/timburke/src/welldone/MoMo-Firmware/momo_modules/test/pic24/unity/unity.c
Creating test runner
Compiling build/test/24fj64ga306/test_rpc_queue/objects/main.c
Linking build/test/24fj64ga306/test_rpc_queue/objects/test_rpc_queue.elf
Running unit test
Processing log file
Creating test summary
Test Summary

## Target 24f16ka101 ##
1/2 tests passed (50% pass rate)
Test test_linkedlist FAILED

## Target 24fj64ga306 ##
2/2 tests passed (100% pass rate)
scons: *** [build/test/output/results.txt] Error 1
scons: building terminated because of errors.
timburke commented 10 years ago

@amcgee You can see the log of the failed test in build/test/output/logs This also fixes momo to not open a shell if the command in the cmd line fails.

amcgee commented 10 years ago

Awesome, if you squash these commits I'm good to go for the merge.

timburke commented 10 years ago

Commits squashed, ready to go.