// unit.h // Unit testing library // Copyright (C) 2019, Jakob Wakeling // MIT Licence #ifndef OMKOV_UNIT_H_YNUUN45Z #define OMKOV_UNIT_H_YNUUN45Z #include #define PASS(message) printf("\033[1;32mPASS\033[0m %s\n", message) #define FAIL(message) printf("\033[1;31mFAIL\033[0m %s\n", message) #define ASSERT(message, condition) do { \ if(condition) { PASS(message); ++testspassed; } \ else { FAIL(message); ++testsfailed; } ++testsrun; \ } while (0) static int testsrun, testspassed, testsfailed; #endif // OMKOV_UNIT_H_YNUUN45Z