summaryrefslogtreecommitdiff
path: root/testsuite.c
diff options
context:
space:
mode:
authorRich Felker <dalias@aerifal.cx>2011-03-19 22:26:06 -0400
committerRich Felker <dalias@aerifal.cx>2011-03-19 22:26:06 -0400
commita9baddd7d07b9fe15e212985a808a79773ec72e4 (patch)
treefce0a089eedeacef8b25b409c2ba50f5f30a8327 /testsuite.c
downloadlibc-testsuite-a9baddd7d07b9fe15e212985a808a79773ec72e4.tar.gz
initial check-in, taken from old libc svn repo with significant additions
Diffstat (limited to 'testsuite.c')
-rw-r--r--testsuite.c38
1 files changed, 38 insertions, 0 deletions
diff --git a/testsuite.c b/testsuite.c
new file mode 100644
index 0000000..3d80b36
--- /dev/null
+++ b/testsuite.c
@@ -0,0 +1,38 @@
+#include <stdio.h>
+
+#define RUN_TEST(a) { \
+extern int test_ ##a (void); \
+int e = test_ ##a (); \
+if (e) printf("%s test failed, %d error(s)\n", #a, e); \
+else printf("%s test passed\n", #a); \
+err += e; \
+}
+
+int main()
+{
+ int err=0;
+
+ RUN_TEST(fdopen);
+ RUN_TEST(fnmatch);
+ RUN_TEST(fscanf);
+ RUN_TEST(popen);
+ RUN_TEST(qsort);
+ RUN_TEST(time);
+ RUN_TEST(sscanf);
+ RUN_TEST(snprintf);
+ RUN_TEST(string);
+ RUN_TEST(strtod);
+ RUN_TEST(strtol);
+ RUN_TEST(ungetc);
+ RUN_TEST(wcstol);
+ RUN_TEST(basename);
+ RUN_TEST(dirname);
+ RUN_TEST(mbc);
+ RUN_TEST(sem);
+ RUN_TEST(pthread);
+ /* env is last because it will break subsequent tests */
+ RUN_TEST(env);
+
+ printf("\ntotal errors: %d\n", err);
+ return !!err;
+}