]> git.proxmox.com Git - libgit2.git/blame - tests/main.c
New upstream version 1.1.0+dfsg.1
[libgit2.git] / tests / main.c
CommitLineData
156cfec0 1#include "clar_libgit2.h"
6b5c0886 2#include "clar_libgit2_trace.h"
156cfec0 3
73b58c91 4#ifdef _WIN32
1d5d4186 5int __cdecl main(int argc, char *argv[])
73b58c91 6#else
1d5d4186 7int main(int argc, char *argv[])
73b58c91 8#endif
156cfec0
VM
9{
10 int res;
ac3d33df 11 char *at_exit_cmd;
156cfec0 12
e0d61c7b
ET
13 clar_test_init(argc, argv);
14
eae0bfdc
PP
15 res = git_libgit2_init();
16 if (res < 0) {
17 fprintf(stderr, "failed to init libgit2");
18 return res;
19 }
20
6b5c0886 21 cl_global_trace_register();
8487e237 22 cl_sandbox_set_search_path_defaults();
e0d61c7b 23
156cfec0 24 /* Run the test suite */
e0d61c7b
ET
25 res = clar_test_run();
26
27 clar_test_shutdown();
156cfec0 28
6b5c0886 29 cl_global_trace_disable();
799e22ea 30 git_libgit2_shutdown();
156cfec0 31
ac3d33df
JK
32 at_exit_cmd = getenv("CLAR_AT_EXIT");
33 if (at_exit_cmd != NULL) {
34 int at_exit = system(at_exit_cmd);
35 return res || at_exit;
36 }
37
156cfec0
VM
38 return res;
39}