diff --git a/Makefile.am b/Makefile.am index c5fc9373..03b204dc 100644 --- a/Makefile.am +++ b/Makefile.am @@ -8,16 +8,11 @@ if WANT_SERVER SERVER_DIR = server endif -if WANT_C_UNIT_TESTS - C_UNIT_TESTS_DIR = test/c-unit-tests -endif - SUBDIRS = \ common \ lib \ $(CLIENT_DIR) \ $(SERVER_DIR) \ - $(C_UNIT_TESTS_DIR) \ doc EXTRA_DIST = \ @@ -459,6 +454,7 @@ EXTRA_DIST = \ test/lcov.env \ test/configure_max_coverage.sh \ test/README \ + test/c-unit-tests/README.md \ VERSION \ win32/config.h \ win32/fwknop-client.vcproj \ diff --git a/configure.ac b/configure.ac index 8fcc79ae..88c476bc 100644 --- a/configure.ac +++ b/configure.ac @@ -756,7 +756,6 @@ AC_CONFIG_FILES([Makefile client/Makefile server/Makefile common/Makefile - test/c-unit-tests/Makefile doc/Makefile]) AC_OUTPUT diff --git a/test/c-unit-tests/Makefile.am b/test/c-unit-tests/Makefile.am deleted file mode 100755 index 23d010d1..00000000 --- a/test/c-unit-tests/Makefile.am +++ /dev/null @@ -1,74 +0,0 @@ -#bin_PROGRAMS = fwknop_utests fwknopd_utests fko_utests -# -#fwknop_utests_SOURCES = fwknop_utests.c \ -# ../../client/config_init.c \ -# ../../client/spa_comm.c \ -# ../../client/utils.c \ -# ../../client/http_resolve_host.c \ -# ../../client/getpasswd.c \ -# ../../client/log_msg.c -# -#fwknop_utests_CPPFLAGS = -I ../../lib -I ../../common -I ../../client -# -#fwknop_utests_LDADD = ../../lib/libfko.la ../../common/libfko_util.a -# -#fwknop_utests_LDFLAGS = -lcunit -# -#fwknopd_utests_SOURCES = fwknopd_utests.c \ -# ../../server/config_init.c \ -# ../../server/incoming_spa.c \ -# ../../server/pcap_capture.c \ -# ../../server/process_packet.c \ -# ../../server/log_msg.c \ -# ../../server/utils.c \ -# ../../server/sig_handler.c \ -# ../../server/replay_cache.c \ -# ../../server/access.c\ -# ../../server/fwknopd_errors.c \ -# ../../server/tcp_server.c \ -# ../../server/extcmd.c \ -# ../../server/fw_util.c \ -# ../../server/fw_util_ipf.c \ -# ../../server/fw_util_ipfw.c \ -# ../../server/fw_util_pf.c \ -# ../../server/fw_util_iptables.c \ -# ../../server/fw_util_firewalld.c -# -#fwknopd_utests_CPPFLAGS = -I ../../lib -I ../../common -I ../../server -DSYSCONFDIR=\"$(sysconfdir)\" -DSYSRUNDIR=\"$(localstatedir)\" -# -#fwknopd_utests_LDADD = $(top_builddir)/lib/libfko.la $(top_builddir)/common/libfko_util.a -# -#fwknopd_utests_LDFLAGS = -lcunit -lpcap -# -#fko_utests_SOURCES = fko_utests.c \ -# ../../lib/base64.c \ -# ../../lib/cipher_funcs.c \ -# ../../lib/digest.c \ -# ../../lib/fko_client_timeout.c \ -# ../../lib/fko_digest.c \ -# ../../lib/fko_encode.c \ -# ../../lib/fko_decode.c \ -# ../../lib/fko_encryption.c \ -# ../../lib/fko_error.c \ -# ../../lib/fko_funcs.c \ -# ../../lib/fko_message.c \ -# ../../lib/fko_nat_access.c \ -# ../../lib/fko_rand_value.c \ -# ../../lib/fko_server_auth.c \ -# ../../lib/fko_timestamp.c \ -# ../../lib/fko_hmac.c \ -# ../../lib/hmac.c \ -# ../../lib/fko_user.c \ -# ../../lib/md5.c \ -# ../../lib/rijndael.c \ -# ../../lib/sha1.c \ -# ../../lib/sha2.c \ -# ../../lib/strlcpy.c \ -# ../../lib/strlcat.c \ -# ../../lib/fko_util.c \ -# ../../lib/gpgme_funcs.c \ -# ../../common/cunit_common.c -# -#fko_utests_CPPFLAGS = -I ../../lib -I ../../common $(GPGME_CFLAGS) -# -#fko_utests_LDFLAGS = -lcunit $(GPGME_LIBS) diff --git a/test/c-unit-tests/README.md b/test/c-unit-tests/README.md index 9066aff9..f91ad304 100644 --- a/test/c-unit-tests/README.md +++ b/test/c-unit-tests/README.md @@ -26,18 +26,19 @@ $ ./test-fwknop.pl --enable-profile-coverage-check --loopback lo --client-only-m ~~~ # Run test suites -Once the build is complete, three test programs allow the user to run the tests suites: +Once the build is complete, the three test programs (each in their respective directories) +allow the user to run the tests suites: - * fwknopd_utests: program to run fwknopd c unit test suites - * fwknop_utests: program to run fwknop c unit test suites - * fko_utests: program to run fko c unit test suites + * fwknopd_utests: program to run fwknopd c unit test suites (located in the server directory) + * fwknop_utests: program to run fwknop c unit test suites (located in the client directory) + * fko_utests: program to run fko c unit test suites (located in the lib directory) ~~~ -$ test/c-unit-tests/fwknopd_utests +$ ./server/fwknopd_utests Suite: Access test suite Test: check compare_port_list function ...FAILED - 1. ../../server/access.c:2017 - compare_port_list(acc_pl, in1_pl, 0) == 0 + 1. access.c:2120 - compare_port_list(acc_pl, in1_pl, 0) == 0 Run Summary: Type Total Ran Passed Failed Inactive suites 1 1 n/a 0 0 @@ -48,7 +49,7 @@ Elapsed time = 0.000 seconds ~~~ ~~~ -$ test/c-unit-tests/fwknop_utests +$ ./client/fwknop_utests Suite: Config init test suite Test: Check critcial vars ...passed @@ -63,7 +64,7 @@ Elapsed time = 0.000 seconds ~~~ ~~~ -$ test/c-unit-tests/fko_utests +$ ./lib/fko_utests Suite: FKO decode test suite Test: Count the number of SPA fields in a SPA packet ...passed