summaryrefslogtreecommitdiff
path: root/src/user/app/tests/tests.h
blob: 248303dd8f15abcea10bf36fa05e22dc0dce241a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#pragma once
#include <camellia/syscalls.h>
#include <stdio.h>
#include <stdlib.h>

#define TMPFILEPATH "/tmp/.test_internal"

void run_test(void (*fn)());

void r_k_fs(void);
void r_k_misc(void);
void r_k_miscsyscall(void);
void r_k_path(void);
void r_k_threads(void);
void r_libc_esemaphore(void);
void r_libc_setjmp(void);
void r_libc_string(void);
void r_s_printf(void);
void r_s_ringbuf(void);

extern FILE *fail_trig;

int forkpipe(FILE **f, handle_t *h);

#define argify(str) str, sizeof(str) - 1
#define test_fail() do { \
	fprintf(fail_trig, "%s():%u", __func__, __LINE__); \
	fflush(fail_trig); \
	exit(0); \
} while (0)
#define test(cond) if (!(cond)) test_fail();