-
Notifications
You must be signed in to change notification settings - Fork 13
Adding Tests
Tests are located in unit_tests.c. They look like this:
You can add your own tests to unit_tests.c, following the same format. You do not need to do anything except write the function in this file and re-make. The new tests will be included in the test index and can be queried the same way.
Valid unit tests have the prototype
int foo(void)
and (normally) return the value returned by a call to the test
function, which has the prototype:
int test(const char *fmt, ...)
The Makefile creates two copies of the unit test, one that replaces test
with ft_printf
, and one that replaces test
with printf
. Running the test compares the output and return value of these two functions.
Tests that start with nocrash
are specially handled by tester. They will automatically pass as long as ft_printf does not crash.
- Home
- Installation
- Usage
- What's NOT Covered
- Workflow with PFT
- Options and Configuration
- Additional Features
- Troubleshooting
- Compatibility With Other Systems
- Contributing to this repo (and possible future features)