summaryrefslogtreecommitdiff
path: root/src/user/app/tests/tests.h
blob: 5f36fe05badc0a1f19e3baa9fa20eab4d24f812e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#pragma once
#include <camellia/syscalls.h>
#include <stdio.h>
#include <unistd.h>

void stress_all(void);
void test_all(void);

void test_pipe(void);
void test_printf(void);
void test_semaphore(void);

#ifdef TEST_MACROS

#define argify(str) str, sizeof(str) - 1
#define test_fail() do { \
	printf("\033[31m" "TEST FAILED: %s():%u\n" "\033[0m", __func__, __LINE__); \
	exit(0); \
} while (0)
#define assert(cond) if (!(cond)) test_fail();

#endif