How to run unittest
You can run the unittest in your local system.
- Create a directory -
lib/and install Unity.
mkdir lib
git clone https://github.com/ThrowTheSwitch/Unity.git lib/
- Write the
unitiestcode insidetest/test_srcdirectory to test all functions of a specific library.- Make sure the
filenamestarts withtest_followed by thelibraryname. - For example,
test_stack_singly_linkedlist_int.c.
- Make sure the
- Run the test.
cd test/
make test TEST_LIB=stack_singly_linkedlist_int
-
It creates
test/test_build/<lib_name>/unittest/directory and saves all test related artifacts over there. -
Clean the test artifacts
make clean TEST_LIB=stack_singly_linkedlist_int