freeswitch/tests/unit
William King a5a3561b2b FS-8233 Clean up formatting 2015-10-09 11:10:32 -07:00
..
.gitignore FS-7820 updated switch_event.c to have benchmark framework, and updated .gitignore file to ignore binary test files 2015-07-10 15:31:11 -07:00
README FS-7820 adding a unit test for switch_hash.c with benchmarking example 2015-07-10 15:09:24 -07:00
switch_event.c FS-8233 convert unit tests frameworks to non-recursive makefiles 2015-10-08 13:01:04 -07:00
switch_hash.c FS-8233 convert unit tests frameworks to non-recursive makefiles 2015-10-08 13:01:04 -07:00
unit.mk FS-8233 Clean up formatting 2015-10-09 11:10:32 -07:00

README

FreeSWITCH unit tests should be kept as shallow unit tests and micro
benchmarks testing functionality exposed through libfreeswitch.

Requirements for a new unit tests: 

1. Tests must use TAP(Test Anything Protocol) output format, and must
print to stderr the summary statistics of the test before exiting.

2. Each test must return 0 on successful completion, or a non-zero
result in case of a failure.

3. Benchmarking stats should be output as a TAP note at the end of the
test in a human and machine(regex) parsable format

Use libtap from https://github.com/zorgnax/libtap
cd /usr/local/src/
git clone https://github.com/zorgnax/libtap.git
make PREFIX=/usr install



To run a benchmark version of a unit test, update the loops count, and
make sure to uncomment the 'BENCHMARK' define line. Then you can run
the benchmark with:

perf record ./.libs/switch_hash

Once that is completed you can view the results with:

perf report