aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul LeoNerd Evans <leonerd@leonerd.org.uk>2013-01-04 17:39:41 +0000
committerPaul LeoNerd Evans <leonerd@leonerd.org.uk>2013-01-04 17:39:41 +0000
commitb4067d8afb3f6d24b341eca46bb031f56011ab05 (patch)
tree50f7cb21f89b2eb927705013065505069bb11d27
parent5190963f1baf22a313ed70a964c2a83174f4e841 (diff)
downloadtermo-b4067d8afb3f6d24b341eca46bb031f56011ab05.tar.gz
termo-b4067d8afb3f6d24b341eca46bb031f56011ab05.tar.xz
termo-b4067d8afb3f6d24b341eca46bb031f56011ab05.zip
Updated shared taplib
-rw-r--r--t/taplib.c18
-rw-r--r--t/taplib.h2
2 files changed, 17 insertions, 3 deletions
diff --git a/t/taplib.c b/t/taplib.c
index 5c23a6e..f9e7425 100644
--- a/t/taplib.c
+++ b/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, ...)
diff --git a/t/taplib.h b/t/taplib.h
index 45ce898..ddb0d20 100644
--- a/t/taplib.h
+++ b/t/taplib.h
@@ -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);