summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2016-07-13 16:10:28 +0200
committerDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2016-11-17 11:36:55 +0100
commit8a00021b2ab5529640e5acaca30a27cdaca04178 (patch)
tree0944317c3e431143eedca84429348334a725e716 /configure.ac
parentd39ea7019cb204420c53a203ff9ccbb4cab0d4b3 (diff)
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 <david.oberhollenzer@sigma-star.at> Signed-off-by: Richard Weinberger <richard@nod.at>
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac38
1 files changed, 38 insertions, 0 deletions
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])],