From 8a00021b2ab5529640e5acaca30a27cdaca04178 Mon Sep 17 00:00:00 2001 From: David Oberhollenzer Date: Wed, 13 Jul 2016 16:10:28 +0200 Subject: Integrate tests into autotools build system Add automake files for the test binaries. If configured to do so, install the test binaries to libexec/mtd-utils and use autoconf to fix the paths in the test scripts. Signed-off-by: David Oberhollenzer Signed-off-by: Richard Weinberger --- configure.ac | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) (limited to 'configure.ac') diff --git a/configure.ac b/configure.ac index c021c6d..233878d 100644 --- a/configure.ac +++ b/configure.ac @@ -1,6 +1,7 @@ AC_PREREQ([2.60]) AC_INIT([mtd-utils], 1.5.2, [linux-mtd@lists.infradead.org], mtd-utils) +AC_CONFIG_MACRO_DIR([m4]) AM_INIT_AUTOMAKE([foreign subdir-objects dist-bzip2]) AM_SILENT_RULES([yes]) AC_PROG_LIBTOOL @@ -8,6 +9,43 @@ AC_DISABLE_STATIC AC_PROG_CC AC_PROG_INSTALL + +AC_ARG_ENABLE([tests], + [AS_HELP_STRING([--disable-tests], [Compile test programs])], + [case "${enableval}" in + yes) AM_CONDITIONAL([BUILD_TESTS], [true]) ;; + no) AM_CONDITIONAL([BUILD_TESTS], [false]) ;; + *) AC_MSG_ERROR([bad value ${enableval} for --disable-tests]) ;; + esac], + [AM_CONDITIONAL([BUILD_TESTS], [true])]) + +AM_COND_IF([BUILD_TESTS], + [AX_PTHREAD([], [AC_MSG_ERROR([pthread missing])])]) + + +AC_ARG_ENABLE([install-tests], + [AS_HELP_STRING([--enable-install-tests], [Install test programs])], + [case "${enableval}" in + yes) AM_CONDITIONAL([INSTALL_TESTS], [true]) ;; + no) AM_CONDITIONAL([INSTALL_TESTS], [false]) ;; + *) AC_MSG_ERROR([bad value ${enableval} for --enable-install-tests]) ;; + esac], + [AM_CONDITIONAL([INSTALL_TESTS], [false])]) + + +AM_COND_IF([INSTALL_TESTS], + [AC_SUBST(testbindir, ["\$libexecpath"])], + [AC_SUBST(testbindir, ["\".\""])]) + + +AC_CONFIG_FILES([tests/fs-tests/fs_help_all.sh + tests/fs-tests/fs_run_all.sh + tests/fs-tests/stress/fs_stress00.sh + tests/fs-tests/stress/fs_stress01.sh + tests/ubi-tests/runubitests.sh + tests/ubi-tests/ubi-stress-test.sh]) + + AC_ARG_WITH([xattr], [AS_HELP_STRING([--without-xattr], [Disable support forextended file attributes])], -- cgit v1.2.3