summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarian Csontos <mcsontos@redhat.com>2015-07-14 20:27:31 +0200
committerMarian Csontos <mcsontos@redhat.com>2015-07-17 20:36:50 +0200
commit2bc0525e939ea38c74a814bd51683955599824a3 (patch)
tree973bfd6dd18b3b42459e7ab16a98d7cb42506f9a
parent85b42d7c9551993f2d9cb48bb84e555ba0af5197 (diff)
downloadlvm2-2bc0525e939ea38c74a814bd51683955599824a3.tar.gz
test: Fix hardcoded /usr/share in testsuite
-rwxr-xr-xconfigure14
-rw-r--r--configure.in11
-rw-r--r--lib/misc/configure.h.in3
-rw-r--r--test/lib/brick-shelltest.h2
4 files changed, 29 insertions, 1 deletions
diff --git a/configure b/configure
index 48f5381c6..139f332de 100755
--- a/configure
+++ b/configure
@@ -649,6 +649,7 @@ UDEV_SYNC
UDEV_RULES
UDEV_PC
THIN
+TESTSUITE_DATA
TESTING
STATIC_LINK
STATICDIR
@@ -7351,6 +7352,9 @@ $as_echo "$ac_cv_flag_HAVE_FULL_RELRO" >&6; }
################################################################################
+if test "$prefix" = NONE; then
+ datarootdir=${ac_default_prefix}/share
+fi
################################################################################
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking file owner" >&5
@@ -10813,6 +10817,16 @@ fi
fi
################################################################################
+TESTSUITE_DATA='${datarootdir}/lvm2-testsuite'
+# double eval needed ${datarootdir} -> ${prefix}/share -> real path
+
+cat >>confdefs.h <<_ACEOF
+#define TESTSUITE_DATA "$(eval echo $(eval echo $TESTSUITE_DATA))"
+_ACEOF
+
+
+
+################################################################################
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable valgrind awareness of pools" >&5
$as_echo_n "checking whether to enable valgrind awareness of pools... " >&6; }
# Check whether --enable-valgrind_pool was given.
diff --git a/configure.in b/configure.in
index ca461af3e..7bb18a480 100644
--- a/configure.in
+++ b/configure.in
@@ -174,6 +174,9 @@ AC_SUBST(HAVE_FULL_RELRO)
################################################################################
dnl -- Prefix is /usr by default, the exec_prefix default is setup later
AC_PREFIX_DEFAULT(/usr)
+if test "$prefix" = NONE; then
+ datarootdir=${ac_default_prefix}/share
+fi
################################################################################
dnl -- Setup the ownership of the files
@@ -1062,6 +1065,13 @@ if test "$TESTING" = yes; then
fi
################################################################################
+dnl -- Set LVM2 testsuite data
+TESTSUITE_DATA='${datarootdir}/lvm2-testsuite'
+# double eval needed ${datarootdir} -> ${prefix}/share -> real path
+AC_DEFINE_UNQUOTED(TESTSUITE_DATA, ["$(eval echo $(eval echo $TESTSUITE_DATA))"], [Path to testsuite data])
+
+
+################################################################################
dnl -- Enable valgrind awareness of memory pools
AC_MSG_CHECKING(whether to enable valgrind awareness of pools)
AC_ARG_ENABLE(valgrind_pool,
@@ -1971,6 +1981,7 @@ AC_SUBST(SNAPSHOTS)
AC_SUBST(STATICDIR)
AC_SUBST(STATIC_LINK)
AC_SUBST(TESTING)
+AC_SUBST(TESTSUITE_DATA)
AC_SUBST(THIN)
AC_SUBST(THIN_CHECK_CMD)
AC_SUBST(THIN_DUMP_CMD)
diff --git a/lib/misc/configure.h.in b/lib/misc/configure.h.in
index d9f5a7dd9..13e8a2dba 100644
--- a/lib/misc/configure.h.in
+++ b/lib/misc/configure.h.in
@@ -632,6 +632,9 @@
/* Define to 1 if you have the ANSI C header files. */
#undef STDC_HEADERS
+/* Path to testsuite data */
+#undef TESTSUITE_DATA
+
/* The path to 'thin_check', if available. */
#undef THIN_CHECK_CMD
diff --git a/test/lib/brick-shelltest.h b/test/lib/brick-shelltest.h
index e64a166e1..21e1eeca6 100644
--- a/test/lib/brick-shelltest.h
+++ b/test/lib/brick-shelltest.h
@@ -1173,7 +1173,7 @@ static int run( int argc, const char **argv, std::string fl_envvar = "TEST_FLAVO
opt.workdir = args.opt( "--workdir" );
if ( opt.testdir.empty() )
- opt.testdir = "/usr/share/lvm2-testsuite";
+ opt.testdir = TESTSUITE_DATA;
if ( opt.workdir.empty() )
opt.workdir = opt.testdir;