bench: pass N as argument, update readme
[libc-test] / common / test.h
index b7b22bd..f1abf56 100644 (file)
@@ -1,19 +1,8 @@
-#include <stdio.h>
-#include <stdarg.h>
-
-extern struct test {
-       int failed;
-       const char *name;
-} test__;
-
+/* use it in test_ functions */
 #define error(...) error__(__FILE__, __LINE__, __VA_ARGS__)
+void error__(const char *n, int l, const char *s, ...);
 
-static void error__(const char *n, int l, const char *s, ...) {
-       va_list ap;
-
-       test__.failed = 1;
-       fprintf(stderr, "- ERROR %s at %s:%d: ", test__.name, n, l);
-       va_start(ap, s);
-       vfprintf(stderr, s, ap);
-       va_end(ap);
-}
+/* use it in bench_ functions */
+void start_timer(void);
+void stop_timer(void);
+void reset_timer(void);