1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-28 03:17:34 +00:00

AK/Tests: Add some macros for testing.

This commit is contained in:
Andreas Kling 2019-06-14 17:36:17 +02:00
parent d900fe98e2
commit 3557f277f6
2 changed files with 62 additions and 20 deletions

19
AK/Tests/TestHelpers.h Normal file
View file

@ -0,0 +1,19 @@
#pragma once
#include <stdio.h>
#define LOG_FAIL(cond) \
fprintf(stderr, "\033[31;1mFAIL\033[0m: " #cond "\n")
#define LOG_PASS(cond) \
fprintf(stderr, "\033[32;1mPASS\033[0m: " #cond "\n")
#define EXPECT(cond) \
do { \
if (!(cond)) { \
LOG_FAIL(cond); \
} else { \
LOG_PASS(cond); \
} \
} while(0)