1 /* vim: set ts=8 sts=4 sw=4 tw=80 noet: */
2 /*======================================================================
3 Copyright (C) 2004,2005,2009,2013 Walter Doekes <walter+tthsum@wjd.nu>
4 This file is part of tthsum.
5
6 tthsum is free software: you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation, either version 3 of the License, or
9 (at your option) any later version.
10
11 tthsum is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
15
16 You should have received a copy of the GNU General Public License
17 along with tthsum. If not, see <http://www.gnu.org/licenses/>.
18 ======================================================================*/
19
20 #include <stdio.h>
21
22
23 extern int base32_test(unsigned*, unsigned*, unsigned*);
24 extern int endian_test(unsigned*, unsigned*, unsigned*);
25 extern int escape_test(unsigned*, unsigned*, unsigned*);
26 extern int getopt_test(unsigned*, unsigned*, unsigned*);
27 extern int read_test(unsigned*, unsigned*, unsigned*);
28 #ifdef USE_TEXTS
29 extern int texts_test(unsigned*, unsigned*, unsigned*);
30 #endif /* !USE_TEXTS */
31 extern int thex_test(unsigned*, unsigned*, unsigned*);
32 extern int tiger_test(unsigned*, unsigned*, unsigned*);
33 extern int types_test(unsigned*, unsigned*, unsigned*);
34 extern int utf8_test(unsigned*, unsigned*, unsigned*);
35
36
main()37 int main() {
38 unsigned success = 0;
39 unsigned failure = 0;
40 unsigned warning = 0;
41
42 printf("============================================\n");
43 printf(" RUNNING TESTS\n");
44 printf("--------------------------------------------\n");
45 printf(" Language\n--------------------------------------------\n");
46 endian_test(&success, &failure, &warning);
47 types_test(&success, &failure, &warning);
48 printf("--------------------------------------------\n");
49 printf(" Util\n--------------------------------------------\n");
50 base32_test(&success, &failure, &warning);
51 escape_test(&success, &failure, &warning);
52 getopt_test(&success, &failure, &warning);
53 read_test(&success, &failure, &warning);
54 utf8_test(&success, &failure, &warning);
55 printf("--------------------------------------------\n");
56 printf(" App\n--------------------------------------------\n");
57 #ifdef USE_TEXTS
58 texts_test(&success, &failure, &warning);
59 #endif /* USE_TEXTS */
60 tiger_test(&success, &failure, &warning);
61 thex_test(&success, &failure, &warning);
62 printf("--------------------------------------------\n");
63 printf(" Tests completed: %u succeeded, %u failed\n",
64 success, failure);
65 if (warning)
66 printf(" %u warning(s)\n", warning);
67 printf("============================================\n");
68
69 if (failure)
70 return 1;
71 return 0;
72 }
73