Last active
May 9, 2018 08:30
-
-
Save hackwerken/c14b5da57c40d339f8d0a1da89b61bfa to your computer and use it in GitHub Desktop.
KissTest
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* 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