...
authoralex <[email protected]>
Tue, 26 Apr 2022 00:36:10 +0000 (17:36 -0700)
committeralex <[email protected]>
Tue, 26 Apr 2022 00:36:10 +0000 (17:36 -0700)
Makefile.am
test/integration/Makefile.am
test/integration/basic.test [new file with mode: 0755]
test/integration/basic.test.c [new file with mode: 0644]
test/integration/test_macros.h [new file with mode: 0644]
test/integration/test_utils.c [new file with mode: 0644]
test/integration/test_utils.h [new file with mode: 0644]

index fd615a7b2e84e84071e759ffc3af15b8aab6de41..9a1fc3c2b0094aac4dd3cffb848bc78e02ae03e2 100644 (file)
@@ -123,3 +123,9 @@ seederd_SOURCES += \
        inc/watch.h
 
 SUBDIRS = . test/unit test/integration bench
+
+# test target/shortcuts
+unit:
+       $(MAKE) -C test/unit check
+integration:
+       $(MAKE) -C test/integration check
index 24046e977806e200a2651c64dbf41ca73525052b..b610eef99165c2f11b9bb88358df634db1a3a01e 100644 (file)
@@ -22,6 +22,7 @@ AM_LOG_FLAGS = --leak-check=full -v --track-origins=yes --error-exitcode=1
 endif
 
 common_SOURCES = \
+       $(seederd_SOURCES) \
        test_utils.c
 
 basic_test_SOURCES = \
diff --git a/test/integration/basic.test b/test/integration/basic.test
new file mode 100755 (executable)
index 0000000..dce9102
Binary files /dev/null and b/test/integration/basic.test differ
diff --git a/test/integration/basic.test.c b/test/integration/basic.test.c
new file mode 100644 (file)
index 0000000..b6a16a3
--- /dev/null
@@ -0,0 +1,7 @@
+#include<test_utils.h>
+
+int main();
+
+int main() {
+       return EXIT_SUCCESS;
+}
diff --git a/test/integration/test_macros.h b/test/integration/test_macros.h
new file mode 100644 (file)
index 0000000..e229fe5
--- /dev/null
@@ -0,0 +1,4 @@
+#ifndef __TEST_MACROS_H_
+#define __TEST_MACROS_H_
+
+#endif
diff --git a/test/integration/test_utils.c b/test/integration/test_utils.c
new file mode 100644 (file)
index 0000000..331953b
--- /dev/null
@@ -0,0 +1,16 @@
+#include<test_utils.h>
+
+void clean_env() {
+       system("rm -rf " PREFIX);
+}
+
+void reset_env() {
+       clean_env();
+       setup_env();
+}
+
+void setup_env() {
+       clean_env();
+
+       srand(time(NULL));
+}
diff --git a/test/integration/test_utils.h b/test/integration/test_utils.h
new file mode 100644 (file)
index 0000000..4e9eb0d
--- /dev/null
@@ -0,0 +1,15 @@
+#ifndef __TEST_UTILS_H_
+#define __TEST_UTILS_H_
+
+#include<test_macros.h>
+
+#include<assert.h>
+#include<stdlib.h>
+#include<string.h>
+#include<time.h>
+
+void clean_env();
+void reset_env();
+void setup_env();
+
+#endif