diff options
Diffstat (limited to 'dev-util/schroot/files/schroot-1.4.7-tests.patch')
-rw-r--r-- | dev-util/schroot/files/schroot-1.4.7-tests.patch | 81 |
1 files changed, 81 insertions, 0 deletions
diff --git a/dev-util/schroot/files/schroot-1.4.7-tests.patch b/dev-util/schroot/files/schroot-1.4.7-tests.patch new file mode 100644 index 000000000000..4a492e7feb97 --- /dev/null +++ b/dev-util/schroot/files/schroot-1.4.7-tests.patch @@ -0,0 +1,81 @@ +--- schroot-1.4.7.orig/configure.ac ++++ schroot-1.4.7/configure.ac +@@ -265,6 +265,19 @@ AC_ARG_WITH([bash-completion-dir], [AS_H + AC_MSG_RESULT([$bashcompletiondir]) + AC_SUBST([bashcompletiondir]) + ++AC_MSG_CHECKING([whether to enable root-only unit tests]) ++AC_ARG_ENABLE([root-tests], [AS_HELP_STRING([--with-root-tests], [Enable root-only tests])], ++ [ case "${enableval}" in ++ yes) enable_root_tests="yes" ;; ++ no) enable_root_tests="no" ;; ++ *) AC_MSG_RESULT([unknown]) ++ AC_MSG_ERROR([bad value ${enableval} for --enable-root-tests]) ;; ++ esac], ++ [ enable_root_tests="yes" ]) ++AC_MSG_RESULT([$enable_root_tests]) ++AM_CONDITIONAL([USE_ROOT_TESTS], [test "$enable_root_tests" = "yes"]) ++AC_SUBST([enable_root_tests]) ++ + # Checks for programs. + AC_PROG_CXX + AC_LANG([C++]) +--- schroot-1.4.7.orig/test/Makefile.am ++++ schroot-1.4.7/test/Makefile.am +@@ -24,10 +24,12 @@ include $(top_srcdir)/scripts/global.mk + LOCAL_CXXFLAGS = $(SCHROOT_CFLAGS) $(CPPUNIT_CFLAGS) -DTESTDATADIR='"./testdata"' -I$(top_srcdir)/bin + + if USE_UNIT_TESTS +-noinst_LTLIBRARIES = libtest.la ++check_LTLIBRARIES = libtest.la + +-noinst_PROGRAMS = \ +- sbuild-chroot \ ++ROOT_TESTS = ++ ++if USE_ROOT_TESTS ++ROOT_TESTS += \ + sbuild-chroot-plain \ + sbuild-chroot-file \ + sbuild-chroot-directory \ +@@ -35,7 +37,12 @@ noinst_PROGRAMS = \ + sbuild-chroot-loopback \ + sbuild-chroot-lvm-snapshot \ + sbuild-chroot-btrfs-snapshot \ +- sbuild-chroot-config \ ++ sbuild-chroot-config ++endif ++ ++check_PROGRAMS = \ ++ sbuild-chroot \ ++ $(ROOT_TESTS) \ + sbuild-environment \ + sbuild-keyfile \ + sbuild-lock \ +@@ -52,14 +59,7 @@ noinst_PROGRAMS = \ + # randomly on slow or heavily-loaded systems. + TESTS = setup-test-data \ + sbuild-chroot \ +- sbuild-chroot-plain \ +- sbuild-chroot-file \ +- sbuild-chroot-directory \ +- sbuild-chroot-block-device \ +- sbuild-chroot-loopback \ +- sbuild-chroot-lvm-snapshot \ +- sbuild-chroot-btrfs-snapshot \ +- sbuild-chroot-config \ ++ $(ROOT_TESTS) \ + sbuild-environment \ + sbuild-keyfile \ + sbuild-log \ +--- schroot-1.4.7.orig/test/setup-test-data ++++ schroot-1.4.7/test/setup-test-data +@@ -4,4 +4,8 @@ + rm -rf testdata + mkdir testdata + cp -r ${srcdir}/*.ex* testdata ++if test `id -u` -ne 0; then ++echo "You are not root, only doing partial setup" ++else + chown -R root:root testdata ++fi |