Skip to content

Epholys/BCUT

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 

Repository files navigation

BCUT

Barebones C Unit Tests

Use

Declare and define every unit test with BCUT_TEST(). In each unit test, use BCUT_ASSERT() to validate a boolean expression. Finally, run a test suite by calling bcut_suite_run().

Exemple

#include"bcut.h"

bool greater(int x, int y) { return x > y; }

BCUT_TEST(greater_test)  { BCUT_ASSERT(greater(1337,42)); }

int main()
{
	bcut_suite_run("Dummy test", 1, greater_test);
	return 0;
}

Hacking

By default, if a unit test fails, a message containing func, LINE and the boolean expression tested is displayed. To avoid buffer overflows, this message has a limited size of 128 bytes defined by the macro BCUT_BUFFER_SIZE which you can easily override.

About

Barebones C Unit Tests

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages