Skip to content

Custom C testing library for graceful conditional assertions and concise failure logs.

Notifications You must be signed in to change notification settings

anshulkamath/c-testing-lib

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Custom C Testing Library

This is a custom built testing library that gracefully checks for assertions without crashing the program. All failed assertions are logged. The images below show the terminal output for passing and failing tests (source code in main/testing-example.c).

anshulkamath::testing » ./bin/testing-example
[PASS] example_passing_test
[FAIL] example_failing_test
        @ main/testing-example.c:16 -> expect(0 == 1);
        @ main/testing-example.c:17 -> expect(0);
        @ main/testing-example.c:18 -> expect(40 + 2 != 42);

In the console:

Installation

To use this library, you must download the repo and make the library archive files. This can be done using

make libs

This will create a lib/ folder with a .a files. You can move this .a file to your project library. Additionally, you must copy the header file testing-logger.h to your project include directory as well. Finally, you must link to -ltesting-logger when compiling.

About

Custom C testing library for graceful conditional assertions and concise failure logs.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published