aboutsummaryrefslogtreecommitdiff
path: root/test/test_framework.c
blob: 8cd53acd460a07fd7de1405423924fcb81965a83 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#include <stdio.h>
#include <stdatomic.h>
#include "test_framework.h"


extern atomic_flag test_framework_assertion_failed;


void test_report_error(
		const char *type, const char *condition, const char *fname, int lineno) {
	printf("\x1B[31;1m%s:%d: Assertion failed:\n  %s(%s)\x1B[0m\n",
			fname, lineno, type, condition);
	atomic_flag_test_and_set(&test_framework_assertion_failed);
}