]>
git.proxmox.com Git - libgit2.git/blob - tests/main.c
1 #include "clar_libgit2.h"
2 #include "clar_libgit2_trace.h"
4 #ifdef GIT_WIN32_LEAKCHECK
5 # include "win32/w32_leakcheck.h"
9 int __cdecl
main(int argc
, char *argv
[])
11 int main(int argc
, char *argv
[])
17 clar_test_init(argc
, argv
);
19 res
= git_libgit2_init();
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
);
27 cl_global_trace_register();
28 cl_sandbox_set_search_path_defaults();
30 /* Run the test suite */
31 res
= clar_test_run();
35 cl_global_trace_disable();
36 git_libgit2_shutdown();
38 #ifdef GIT_WIN32_LEAKCHECK
39 if (git_win32_leakcheck_has_leaks())
43 at_exit_cmd
= getenv("CLAR_AT_EXIT");
44 if (at_exit_cmd
!= NULL
) {
45 int at_exit
= system(at_exit_cmd
);
46 return res
|| at_exit
;