unit-tests: Separate test runner to a library, reusable by other tests
Other users may make use of the noinst libtest.la helper library to implement unit tests. For libstrongswan, tests.[ch] provide the configuration for test runner to perform unit tests in a simple manner.
This commit is contained in:
@@ -1,9 +1,24 @@
|
||||
TESTS = test_runner
|
||||
check_LTLIBRARIES = libtest.la
|
||||
|
||||
libtest_la_SOURCES = \
|
||||
test_suite.c test_suite.h \
|
||||
test_runner.c test_runner.h
|
||||
|
||||
libtest_la_CFLAGS = \
|
||||
-I$(top_srcdir)/src/libstrongswan \
|
||||
@COVERAGE_CFLAGS@
|
||||
|
||||
libtest_la_LDFLAGS = @COVERAGE_LDFLAGS@
|
||||
libtest_la_LIBADD = \
|
||||
$(top_builddir)/src/libstrongswan/libstrongswan.la \
|
||||
$(PTHREADLIB)
|
||||
|
||||
|
||||
TESTS = tests
|
||||
|
||||
check_PROGRAMS = $(TESTS)
|
||||
|
||||
test_runner_SOURCES = \
|
||||
test_runner.c test_runner.h test_suite.c test_suite.h \
|
||||
tests_SOURCES = tests.h tests.c \
|
||||
suites/test_linked_list.c \
|
||||
suites/test_enumerator.c \
|
||||
suites/test_linked_list_enumerator.c \
|
||||
@@ -26,13 +41,14 @@ test_runner_SOURCES = \
|
||||
suites/test_asn1.c \
|
||||
suites/test_printf.c
|
||||
|
||||
test_runner_CFLAGS = \
|
||||
tests_CFLAGS = \
|
||||
-I$(top_srcdir)/src/libstrongswan \
|
||||
-I$(top_srcdir)/src/libstrongswan/tests \
|
||||
-DPLUGINDIR=\""$(top_builddir)/src/libstrongswan/plugins\"" \
|
||||
-DPLUGINS=\""${s_plugins}\"" \
|
||||
@COVERAGE_CFLAGS@
|
||||
|
||||
test_runner_LDFLAGS = @COVERAGE_LDFLAGS@
|
||||
test_runner_LDADD = \
|
||||
tests_LDFLAGS = @COVERAGE_LDFLAGS@
|
||||
tests_LDADD = \
|
||||
$(top_builddir)/src/libstrongswan/libstrongswan.la \
|
||||
$(PTHREADLIB)
|
||||
libtest.la
|
||||
|
||||
Reference in New Issue
Block a user