projects
/
libc-test
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
new test framework (one main per test)
[libc-test]
/
src
/
misc
/
test.h
1
#include <stdio.h>
2
#include <stdarg.h>
3
#define error(...) test_error(__FILE__, __LINE__, __VA_ARGS__)
4
5
static int test_status;
6
7
static int test_error(const char *n, int l, const char *s, ...)
8
{
9
va_list ap;
10
11
if (test_status == 0)
12
printf("FAIL\n");
13
test_status = 1;
14
printf(" ERROR %s:%d: ", n, l);
15
va_start(ap, s);
16
vprintf(s, ap);
17
va_end(ap);
18
return -1;
19
}
20