]> git.proxmox.com Git - libgit2.git/blob - tests/test_main.c
t12-repo.c: fix failing test discover0
[libgit2.git] / tests / test_main.c
1 /*
2 * This file is free software; you can redistribute it and/or modify
3 * it under the terms of the GNU General Public License, version 2,
4 * as published by the Free Software Foundation.
5 *
6 * In addition to the permissions in the GNU General Public License,
7 * the authors give you unlimited permission to link the compiled
8 * version of this file into combinations with other programs,
9 * and to distribute those combinations without any restriction
10 * coming from the use of this file. (The General Public License
11 * restrictions do apply in other respects; for example, they cover
12 * modification of the file, and distribution when not linked into
13 * a combined executable.)
14 *
15 * This file is distributed in the hope that it will be useful, but
16 * WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 * General Public License for more details.
19 *
20 * You should have received a copy of the GNU General Public License
21 * along with this program; see the file COPYING. If not, write to
22 * the Free Software Foundation, 51 Franklin Street, Fifth Floor,
23 * Boston, MA 02110-1301, USA.
24 */
25
26 #include <string.h>
27 #include <git2.h>
28
29 #include "test_lib.h"
30 #include "test_helpers.h"
31
32 DECLARE_SUITE(core);
33 DECLARE_SUITE(rawobjects);
34 DECLARE_SUITE(objread);
35 DECLARE_SUITE(objwrite);
36 DECLARE_SUITE(commit);
37 DECLARE_SUITE(revwalk);
38 DECLARE_SUITE(index);
39 DECLARE_SUITE(hashtable);
40 DECLARE_SUITE(tag);
41 DECLARE_SUITE(tree);
42 DECLARE_SUITE(refs);
43 DECLARE_SUITE(repository);
44 DECLARE_SUITE(threads);
45 DECLARE_SUITE(config);
46 DECLARE_SUITE(remotes);
47 DECLARE_SUITE(buffers);
48 DECLARE_SUITE(status);
49
50 static libgit2_suite suite_methods[]= {
51 SUITE_NAME(core),
52 SUITE_NAME(rawobjects),
53 SUITE_NAME(objread),
54 SUITE_NAME(objwrite),
55 SUITE_NAME(commit),
56 SUITE_NAME(revwalk),
57 SUITE_NAME(index),
58 SUITE_NAME(hashtable),
59 SUITE_NAME(tag),
60 SUITE_NAME(tree),
61 SUITE_NAME(refs),
62 SUITE_NAME(repository),
63 SUITE_NAME(threads),
64 SUITE_NAME(config),
65 SUITE_NAME(remotes),
66 SUITE_NAME(buffers),
67 SUITE_NAME(status),
68 };
69
70 #define GIT_SUITE_COUNT (ARRAY_SIZE(suite_methods))
71
72 #ifdef GIT_WIN32
73 int __cdecl
74 #else
75 int
76 #endif
77 main(int GIT_UNUSED(argc), char *GIT_UNUSED(argv[]))
78 {
79 unsigned int i, failures;
80
81 GIT_UNUSED_ARG(argc);
82 GIT_UNUSED_ARG(argv);
83
84 failures = 0;
85
86 for (i = 0; i < GIT_SUITE_COUNT; ++i)
87 failures += git_testsuite_run(suite_methods[i]());
88
89 return failures ? -1 : 0;
90 }
91