Remove building with NOCRYPTO option
[minix.git] / external / bsd / libc++ / dist / libcxxrt / test / test.cc
blob520286c1b763f51c06527e07cfea1ded3c373513
1 #include <stdio.h>
2 #include <stdlib.h>
3 #include <unistd.h>
6 static int succeeded;
7 static int failed;
8 static bool verbose;
10 void log_test(bool predicate, const char *file, int line, const char *message)
12 if (predicate)
14 if (verbose)
16 printf("Test passed: %s:%d: %s\n", file, line, message);
18 succeeded++;
19 return;
21 failed++;
22 printf("Test failed: %s:%d: %s\n", file, line, message);
25 static void log_totals(void)
27 printf("\n%d tests, %d passed, %d failed\n", succeeded+failed, succeeded, failed);
30 static void __attribute__((constructor)) init(void)
32 atexit(log_totals);
35 void test_type_info(void);
36 void test_exceptions();
37 void test_guards(void);
38 int main(int argc, char **argv)
40 int ch;
42 while ((ch = getopt(argc, argv, "v")) != -1)
44 switch (ch)
46 case 'v':
47 verbose = true;
48 default: break;
52 test_type_info();
53 test_guards();
54 test_exceptions();
55 return 0;