aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/gistatic.c14
-rw-r--r--src/gistatic.h6
-rw-r--r--src/main.c5
3 files changed, 19 insertions, 6 deletions
diff --git a/src/gistatic.c b/src/gistatic.c
index a60aa81..fce6959 100644
--- a/src/gistatic.c
+++ b/src/gistatic.c
@@ -1964,12 +1964,7 @@ static void unit_tests(){
}
#endif
-int main(int argc, char *argv[]) {
-#ifdef TEST
- unit_tests();
- return EXIT_SUCCESS;
-#endif
-
+int gistatic_main(int argc, char *argv[]) {
int ret = EXIT_SUCCESS;
bool cleanup_libgit = false;
catalog_descriptor = catopen(CATALOG_NAME, NL_CAT_LOCALE);
@@ -2088,3 +2083,10 @@ cleanup:
}
return ret;
}
+
+#ifdef TEST
+int main(void) {
+ unit_tests();
+ return EXIT_SUCCESS;
+}
+#endif
diff --git a/src/gistatic.h b/src/gistatic.h
new file mode 100644
index 0000000..03c02f6
--- /dev/null
+++ b/src/gistatic.h
@@ -0,0 +1,6 @@
+#ifndef GISTATIC_GISTATIC_H
+#define GISTATIC_GISTATIC_H
+
+int gistatic_main(int argc, char *argv[]);
+
+#endif
diff --git a/src/main.c b/src/main.c
new file mode 100644
index 0000000..52c749f
--- /dev/null
+++ b/src/main.c
@@ -0,0 +1,5 @@
+#include "gistatic.h"
+
+int main(int argc, char *argv[]) {
+ return gistatic_main(argc, argv);
+}