Updated shared taplib
This commit is contained in:
parent
5190963f1b
commit
b4067d8afb
18
t/taplib.c
18
t/taplib.c
|
@ -12,11 +12,23 @@ void plan_tests(int n)
|
|||
printf("1..%d\n", n);
|
||||
}
|
||||
|
||||
void pass(char *name)
|
||||
{
|
||||
printf("ok %d - %s\n", nexttest++, name);
|
||||
}
|
||||
|
||||
void fail(char *name)
|
||||
{
|
||||
printf("not ok %d - %s\n", nexttest++, name);
|
||||
_exit_status = 1;
|
||||
}
|
||||
|
||||
void ok(int cmp, char *name)
|
||||
{
|
||||
printf("%s %d - %s\n", cmp ? "ok" : "not ok", nexttest++, name);
|
||||
if(!cmp)
|
||||
_exit_status = 1;
|
||||
if(cmp)
|
||||
pass(name);
|
||||
else
|
||||
fail(name);
|
||||
}
|
||||
|
||||
void diag(char *fmt, ...)
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
void plan_tests(int n);
|
||||
void ok(int cmp, char *name);
|
||||
void pass(char *name);
|
||||
void fail(char *name);
|
||||
void is_int(int got, int expect, char *name);
|
||||
void is_str(const char *got, const char *expect, char *name);
|
||||
int exit_status(void);
|
||||
|
|
Loading…
Reference in New Issue