From bb3a3a61fe7b971ad8ef326ec7e4d5903e6860ee Mon Sep 17 00:00:00 2001 From: Benjamin Barenblat Date: Mon, 27 Jan 2014 15:15:43 -0800 Subject: Functional tests for C library MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit While gearing up to make an addition to the C library, I became concerned at the lack of test infrastructure for the project. The build system now integrates Check , a lightweight testing framework for C, and there are a few tests to ensure no serious regressions occur. You can run the tests with “make check”. --- configure.ac | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) (limited to 'configure.ac') diff --git a/configure.ac b/configure.ac index 0b4b5fa..3e3a1d8 100644 --- a/configure.ac +++ b/configure.ac @@ -60,11 +60,33 @@ DX_PDF_FEATURE(OFF) DX_PS_FEATURE(OFF) DX_INIT_DOXYGEN([ppamltracer], [Doxyfile], [doc]) +# Tests +AC_CHECK_HEADERS([ftw.h unistd.h sys/stat.h time.h]) +AC_CHECK_TYPES( + [struct FTW], + [], + [], + [[#define _XOPEN_SOURCE 500 +#include ]]) +AC_CHECK_TYPES( + [struct timespec], + [], + [], + [[#define _POSIX_C_SOURCE 199309L +#include ]]) +AC_CHECK_FUNCS([mkdtemp nanosleep nftw]) +PKG_CHECK_MODULES([check], [check >= 0.9.4], + [], + [AC_MSG_WARN([check not found; `make check' will fail])]) +AC_SUBST([check_CFLAGS]) +AC_SUBST([check_LIBS]) + # Generate Makefiles and pkg-config file. AC_CONFIG_FILES([ Makefile src/Makefile - include/Makefile]) + include/Makefile + test/Makefile]) AC_CONFIG_FILES([ppamltracer.pc]) # All done. -- cgit v1.2.3