2016-12-02 08:36:33 +00:00
|
|
|
# UNIT TESTING
|
|
|
|
|
|
|
|
This folder contains a archetype and several unit-tests for CCExtractor
|
|
|
|
|
|
|
|
## RUN TESTS
|
|
|
|
|
|
|
|
```shell
|
|
|
|
cd tests
|
|
|
|
make
|
|
|
|
```
|
|
|
|
|
|
|
|
This will build and run all test-suite.
|
|
|
|
|
|
|
|
If you want MORE output:
|
|
|
|
|
|
|
|
```shell
|
|
|
|
DEBUG=1 make
|
|
|
|
```
|
|
|
|
|
|
|
|
Where `DEBUG` is just an environment variable.
|
|
|
|
|
|
|
|
## DEBUGGING
|
|
|
|
|
2017-01-10 23:46:10 +00:00
|
|
|
If tests fail after your changes, you could try to debug the failed tests.
|
2016-12-02 08:36:33 +00:00
|
|
|
|
2017-01-10 23:46:10 +00:00
|
|
|
Run following commands in the `/tests` directory:
|
2016-12-02 08:36:33 +00:00
|
|
|
|
|
|
|
```shell
|
2017-01-10 23:46:10 +00:00
|
|
|
# build test runner (executable file - runtest)
|
2016-12-02 08:36:33 +00:00
|
|
|
make
|
2017-01-10 23:46:10 +00:00
|
|
|
# load runtest to the debgger:
|
|
|
|
gdb runtest
|
2016-12-02 08:36:33 +00:00
|
|
|
|
2017-01-10 23:46:10 +00:00
|
|
|
# start under debugger:
|
2016-12-02 08:36:33 +00:00
|
|
|
(gdb) run
|
|
|
|
|
2017-01-10 23:46:10 +00:00
|
|
|
# if segfault occured:
|
2016-12-02 08:36:33 +00:00
|
|
|
(gdb) where
|
|
|
|
```
|
|
|
|
|
|
|
|
## DEPENDENCIES
|
|
|
|
|
|
|
|
Tests are built around this library: [**libcheck**](https://github.com/libcheck/check), here is [**documentation**](https://libcheck.github.io/check/)
|