aboutsummaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorGravatar Benjamin Barenblat <bbarenblat@galois.com>2014-01-27 15:15:43 -0800
committerGravatar Benjamin Barenblat <bbarenblat@galois.com>2014-01-27 15:17:06 -0800
commitbb3a3a61fe7b971ad8ef326ec7e4d5903e6860ee (patch)
tree1e7cb626e710d0cf1888ee89f45e65afb5b41a13 /configure.ac
parentecdc86999a7eb30223209887801ec8bbeac1cc9e (diff)
Functional tests for C library
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 <http://check.sourceforge.net/>;, 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”.
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac24
1 files changed, 23 insertions, 1 deletions
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 <ftw.h>]])
+AC_CHECK_TYPES(
+ [struct timespec],
+ [],
+ [],
+ [[#define _POSIX_C_SOURCE 199309L
+#include <time.h>]])
+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.