From 7a337f88ef97367cc181a1d897381f22890b61a4 Mon Sep 17 00:00:00 2001 From: Elvira Khabirova Date: Sat, 4 Mar 2023 23:56:44 +0100 Subject: Add a configure flag for installing tests --enable-install-tests=yes installs binaries and scripts from the test suite to $libexec/strace. This flag does not install everything necessary to run the test suite (no harness), but at least installs the binaries and the scripts. This can be useful when debugging various targets and how strace behaves on them. This can also be extended later with a standalone test harness that would allow for an easier testing. * configure.ac: Add --enable-install-tests. * tests/Makefile.am [ENABLE_INSTALL_TESTS] (testslibexecdir, testslibexec_PROGRAMS, testslibexec_DATA, testslibexec_SCRIPTS): New variables. Signed-off-by: Elvira Khabirova --- configure.ac | 13 +++++++++++++ tests/Makefile.am | 7 +++++++ 2 files changed, 20 insertions(+) diff --git a/configure.ac b/configure.ac index 86d08d830..efd0632e8 100644 --- a/configure.ac +++ b/configure.ac @@ -797,6 +797,19 @@ m4_foreach([pers], [M32, MX32], dnl st_MPERS([m32], [aarch64|powerpc64|s390x|sparc64|tile|x32|x86_64]) st_MPERS([mx32], [x86_64]) +AC_ARG_ENABLE([install-tests], + [AS_HELP_STRING([--enable-install-tests=yes|no], + [whether to install tests into libexec/strace, + default is no.])], + [case "$enableval" in + yes|no) enable_install_tests="$enableval" ;; + *) AC_MSG_ERROR([bad value $enableval for enable-install-tests option. +Valid options are: yes, no.]) + ;; + esac], + [enable_install_tests=no]) +AM_CONDITIONAL([ENABLE_INSTALL_TESTS], [test x$enable_install_tests = xyes]) + AX_VALGRIND_DFLT([sgcheck], [off]) AX_VALGRIND_CHECK diff --git a/tests/Makefile.am b/tests/Makefile.am index d39d56511..9cbfc33f8 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -804,6 +804,13 @@ EXTRA_DIST = \ $(TESTS) \ # end of EXTRA_DIST +if ENABLE_INSTALL_TESTS +testslibexecdir = $(libexecdir)/strace/tests$(MPERS_NAME) +testslibexec_PROGRAMS = $(check_PROGRAMS) +testslibexec_DATA = $(check_DATA) +testslibexec_SCRIPTS = $(check_SCRIPTS) $(TESTS) +endif + ksysent.h: $(srcdir)/ksysent.sed echo '#include ' | \ $(CPP) $(AM_CPPFLAGS) $(CPPFLAGS) -dM - > $@.t1 -- cgit v1.2.1