summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorElvira Khabirova <lineprinter0@gmail.com>2023-03-04 23:56:44 +0100
committerElvira Khabirova <lineprinter0@gmail.com>2023-03-05 22:29:32 +0100
commit7a337f88ef97367cc181a1d897381f22890b61a4 (patch)
tree52079e934001b931f8dd9f5a825e53dd3e05e56f
parent298d5bf543018a37074d9df75548c3ef4edab8eb (diff)
downloadstrace-7a337f88ef97367cc181a1d897381f22890b61a4.tar.gz
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 <lineprinter0@gmail.com>
-rw-r--r--configure.ac13
-rw-r--r--tests/Makefile.am7
2 files changed, 20 insertions, 0 deletions
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 <asm/unistd.h>' | \
$(CPP) $(AM_CPPFLAGS) $(CPPFLAGS) -dM - > $@.t1