From: alex Date: Tue, 26 Apr 2022 00:36:10 +0000 (-0700) Subject: ... X-Git-Url: http://git.infiniteadaptability.org/?a=commitdiff_plain;h=5789562646d6fd97a3214198f8eb92f4d2836171;p=seeder ... --- diff --git a/Makefile.am b/Makefile.am index fd615a7..9a1fc3c 100644 --- a/Makefile.am +++ b/Makefile.am @@ -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 diff --git a/test/integration/Makefile.am b/test/integration/Makefile.am index 24046e9..b610eef 100644 --- a/test/integration/Makefile.am +++ b/test/integration/Makefile.am @@ -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 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 index 0000000..b6a16a3 --- /dev/null +++ b/test/integration/basic.test.c @@ -0,0 +1,7 @@ +#include + +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 index 0000000..e229fe5 --- /dev/null +++ b/test/integration/test_macros.h @@ -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 index 0000000..331953b --- /dev/null +++ b/test/integration/test_utils.c @@ -0,0 +1,16 @@ +#include + +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 index 0000000..4e9eb0d --- /dev/null +++ b/test/integration/test_utils.h @@ -0,0 +1,15 @@ +#ifndef __TEST_UTILS_H_ +#define __TEST_UTILS_H_ + +#include + +#include +#include +#include +#include + +void clean_env(); +void reset_env(); +void setup_env(); + +#endif