Skip to content

Instantly share code, notes, and snippets.

@hackwerken
Last active May 9, 2018 08:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hackwerken/c14b5da57c40d339f8d0a1da89b61bfa to your computer and use it in GitHub Desktop.
Save hackwerken/c14b5da57c40d339f8d0a1da89b61bfa to your computer and use it in GitHub Desktop.
KissTest
/* Keep it simple, stupid. Test.
* Simple unittesting without any dependencies.
*/
#include <stdio.h>
#define FAIL(test, msg) printf("[FAIL] Test %s failed: %s, on line %d\n", test, msg, __LINE__)
#define PASS(test) printf("[PASS] Test %s succeeded\n", test)
static void test_example()
{
int a = 4;
int b = 20;
if(a == b) {
FAIL("example", "compiler broken");
return;
}
PASS("example");
}
int main(int argc, char *argv[])
{
test_example();
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment