]> git.proxmox.com Git - libgit2.git/blob - tests/main.c
re-enable SSH support
[libgit2.git] / tests / main.c
1 #include "clar_libgit2.h"
2 #include "clar_libgit2_trace.h"
3
4 #ifdef GIT_WIN32_LEAKCHECK
5 # include "win32/w32_leakcheck.h"
6 #endif
7
8 #ifdef _WIN32
9 int __cdecl main(int argc, char *argv[])
10 #else
11 int main(int argc, char *argv[])
12 #endif
13 {
14 int res;
15 char *at_exit_cmd;
16
17 clar_test_init(argc, argv);
18
19 res = git_libgit2_init();
20 if (res < 0) {
21 const git_error *err = git_error_last();
22 const char *msg = err ? err->message : "unknown failure";
23 fprintf(stderr, "failed to init libgit2: %s\n", msg);
24 return res;
25 }
26
27 cl_global_trace_register();
28 cl_sandbox_set_search_path_defaults();
29 cl_sandbox_disable_ownership_validation();
30
31 /* Run the test suite */
32 res = clar_test_run();
33
34 clar_test_shutdown();
35
36 cl_global_trace_disable();
37 git_libgit2_shutdown();
38
39 #ifdef GIT_WIN32_LEAKCHECK
40 if (git_win32_leakcheck_has_leaks())
41 res = res || 1;
42 #endif
43
44 at_exit_cmd = getenv("CLAR_AT_EXIT");
45 if (at_exit_cmd != NULL) {
46 int at_exit = system(at_exit_cmd);
47 return res || at_exit;
48 }
49
50 return res;
51 }