aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/gistatic.c10
-rw-r--r--src/gistatic.h4
-rw-r--r--src/main.c15
-rw-r--r--src/tar.c32
-rw-r--r--src/tar.h5
5 files changed, 27 insertions, 39 deletions
diff --git a/src/gistatic.c b/src/gistatic.c
index a2b10fc..0a65b6c 100644
--- a/src/gistatic.c
+++ b/src/gistatic.c
@@ -1,4 +1,5 @@
#include "config.h"
+#include "tar.h"
#include "gistatic.h"
#include <stdlib.h>
@@ -2046,7 +2047,7 @@ cleanup:
}
#ifdef TEST
-static void unit_tests(){
+void unit_tests_gistatic(void) {
dump_translatable_strings();
git_libgit2_init();
@@ -2182,10 +2183,3 @@ cleanup:
}
return ret;
}
-
-#ifdef TEST
-int main(void) {
- unit_tests();
- return EXIT_SUCCESS;
-}
-#endif
diff --git a/src/gistatic.h b/src/gistatic.h
index 03c02f6..7e022fa 100644
--- a/src/gistatic.h
+++ b/src/gistatic.h
@@ -3,4 +3,8 @@
int gistatic_main(int argc, char *argv[]);
+#ifdef TEST
+void unit_tests_gistatic(void);
+#endif
+
#endif
diff --git a/src/main.c b/src/main.c
index 52c749f..34214ea 100644
--- a/src/main.c
+++ b/src/main.c
@@ -1,5 +1,20 @@
+#include "tar.h"
#include "gistatic.h"
+#include <stdlib.h>
+
+#ifdef TEST
+static void unit_tests(void) {
+ unit_tests_tar();
+ unit_tests_gistatic();
+}
+#endif
+
int main(int argc, char *argv[]) {
+#ifdef TEST
+ unit_tests();
+ return EXIT_SUCCESS;
+#endif
+
return gistatic_main(argc, argv);
}
diff --git a/src/tar.c b/src/tar.c
index 63aebe8..43a580c 100644
--- a/src/tar.c
+++ b/src/tar.c
@@ -1,36 +1,6 @@
#include "config.h"
#include "tar.h"
-
#ifdef TEST
-
-#include "tests-lib.h"
-
-#include <stdbool.h>
-#include <stdlib.h>
-#include <assert.h>
-
-#endif
-
-
-void a(void) { }
-
-#ifdef TEST
-static void test_a(void) {
- test_start("test_a:");
- {
- testing("a");
- assert(true);
- test_ok();
- }
-}
-
-static void unit_tests(void) {
- test_a();
-}
-
-int main(void) {
- unit_tests();
- return EXIT_SUCCESS;
-}
+void unit_tests_tar(void) {}
#endif
diff --git a/src/tar.h b/src/tar.h
index 09d1c18..29c75bc 100644
--- a/src/tar.h
+++ b/src/tar.h
@@ -1,3 +1,8 @@
#ifndef GISTATIC_TAR_H
#define GISTATIC_TAR_H
+
+#ifdef TEST
+void unit_tests_tar(void);
+#endif
+
#endif