From c610b5bacf5ea11c727e5c7a7f15db252fd338df Mon Sep 17 00:00:00 2001 From: Jürgen Knödlseder Date: Tue, 12 Nov 2013 09:59:36 +0100 Subject: [PATCH] Replace GAMMALIB_SOURCE environment variable by PACKAGE_SOURCE environment variable in unit tests and use PACKAGE_SOURCE determine in configure instead of abs_top_srcdir as the latter does not exist on older systems. --- .gitignore | 3 +++ configure.ac | 9 ++++++++- inst/com/test/data/obs.xml | 8 ++++---- inst/cta/test/data/irf_binned.xml | 8 ++++---- inst/cta/test/data/irf_unbinned.xml | 8 ++++---- inst/cta/test/data/obs_binned.xml | 2 +- inst/cta/test/data/obs_unbinned.xml | 2 +- inst/lat/test/data/p6v3/obs_binned.xml | 8 ++++---- inst/lat/test/data/p6v3/obs_unbinned.xml | 8 ++++---- inst/lat/test/data/p6v3/source_model.xml | 4 ++-- inst/lat/test/data/p7v6/obs_binned.xml | 8 ++++---- inst/lat/test/data/p7v6/obs_unbinned.xml | 8 ++++---- inst/lat/test/data/p7v6/source_model.xml | 4 ++-- inst/mwl/test/data/crab.xml | 22 +++++++++++----------- inst/mwl/test/data/obs_mwl.xml | 6 +++--- test/Makefile.am | 4 ++-- 16 files changed, 61 insertions(+), 51 deletions(-) diff --git a/.gitignore b/.gitignore index a9dc9c1..e2021a1 100644 --- a/.gitignore +++ b/.gitignore @@ -37,6 +37,9 @@ m4/lt~obsolete.m4 *.cpp~ *.hpp~ *.i~ +*.xml~ +*.ac~ +*.am~ .gitignore~ Makefile stamp-h1 diff --git a/configure.ac b/configure.ac index d80ea63..7eb6b6f 100644 --- a/configure.ac +++ b/configure.ac @@ -60,7 +60,14 @@ else gammalib_prefix=${prefix} fi AC_DEFINE_UNQUOTED([PACKAGE_PREFIX], "${gammalib_prefix}", [Location where library is installed]) -AC_DEFINE_UNQUOTED([PACKAGE_SOURCE], "`pwd`", [Location where source is installed]) + + +############################################################################# +# Determine source directory for unit testing # +############################################################################# +PACKAGE_SOURCE=`pwd` +AC_DEFINE_UNQUOTED([PACKAGE_SOURCE], "${PACKAGE_SOURCE}", [Location where source is installed]) +AC_SUBST(PACKAGE_SOURCE) ############################################################################# diff --git a/inst/com/test/data/obs.xml b/inst/com/test/data/obs.xml index d493666..a68f795 100644 --- a/inst/com/test/data/obs.xml +++ b/inst/com/test/data/obs.xml @@ -1,9 +1,9 @@ - - - - + + + + \ No newline at end of file diff --git a/inst/cta/test/data/irf_binned.xml b/inst/cta/test/data/irf_binned.xml index c0bb05c..3a6d749 100644 --- a/inst/cta/test/data/irf_binned.xml +++ b/inst/cta/test/data/irf_binned.xml @@ -1,8 +1,8 @@ - - - - + + + + diff --git a/inst/cta/test/data/irf_unbinned.xml b/inst/cta/test/data/irf_unbinned.xml index 59420c6..13dcb3c 100644 --- a/inst/cta/test/data/irf_unbinned.xml +++ b/inst/cta/test/data/irf_unbinned.xml @@ -1,8 +1,8 @@ - - - - + + + + diff --git a/inst/cta/test/data/obs_binned.xml b/inst/cta/test/data/obs_binned.xml index e0beb0b..1057e7e 100644 --- a/inst/cta/test/data/obs_binned.xml +++ b/inst/cta/test/data/obs_binned.xml @@ -1,6 +1,6 @@ - + diff --git a/inst/cta/test/data/obs_unbinned.xml b/inst/cta/test/data/obs_unbinned.xml index 4a1374f..63564a9 100644 --- a/inst/cta/test/data/obs_unbinned.xml +++ b/inst/cta/test/data/obs_unbinned.xml @@ -1,6 +1,6 @@ - + diff --git a/inst/lat/test/data/p6v3/obs_binned.xml b/inst/lat/test/data/p6v3/obs_binned.xml index 47d15b9..9550d77 100644 --- a/inst/lat/test/data/p6v3/obs_binned.xml +++ b/inst/lat/test/data/p6v3/obs_binned.xml @@ -1,8 +1,8 @@ - - - - + + + + diff --git a/inst/lat/test/data/p6v3/obs_unbinned.xml b/inst/lat/test/data/p6v3/obs_unbinned.xml index b32b8d8..214e627 100644 --- a/inst/lat/test/data/p6v3/obs_unbinned.xml +++ b/inst/lat/test/data/p6v3/obs_unbinned.xml @@ -1,8 +1,8 @@ - - - - + + + + diff --git a/inst/lat/test/data/p6v3/source_model.xml b/inst/lat/test/data/p6v3/source_model.xml index 4e1c3db..7cdbd71 100644 --- a/inst/lat/test/data/p6v3/source_model.xml +++ b/inst/lat/test/data/p6v3/source_model.xml @@ -1,6 +1,6 @@ - + @@ -11,7 +11,7 @@ - + diff --git a/inst/lat/test/data/p7v6/obs_binned.xml b/inst/lat/test/data/p7v6/obs_binned.xml index 0135dad..13017a9 100644 --- a/inst/lat/test/data/p7v6/obs_binned.xml +++ b/inst/lat/test/data/p7v6/obs_binned.xml @@ -1,8 +1,8 @@ - - - - + + + + diff --git a/inst/lat/test/data/p7v6/obs_unbinned.xml b/inst/lat/test/data/p7v6/obs_unbinned.xml index da33f01..5f8422c 100644 --- a/inst/lat/test/data/p7v6/obs_unbinned.xml +++ b/inst/lat/test/data/p7v6/obs_unbinned.xml @@ -1,8 +1,8 @@ - - - - + + + + diff --git a/inst/lat/test/data/p7v6/source_model.xml b/inst/lat/test/data/p7v6/source_model.xml index 3330791..224399f 100644 --- a/inst/lat/test/data/p7v6/source_model.xml +++ b/inst/lat/test/data/p7v6/source_model.xml @@ -1,6 +1,6 @@ - + @@ -11,7 +11,7 @@ - + diff --git a/inst/mwl/test/data/crab.xml b/inst/mwl/test/data/crab.xml index 1b2e7a3..c43fa18 100644 --- a/inst/mwl/test/data/crab.xml +++ b/inst/mwl/test/data/crab.xml @@ -1,14 +1,14 @@ - - - - - - - - - - - + + + + + + + + + + + diff --git a/inst/mwl/test/data/obs_mwl.xml b/inst/mwl/test/data/obs_mwl.xml index 3ec65da..0ca245a 100644 --- a/inst/mwl/test/data/obs_mwl.xml +++ b/inst/mwl/test/data/obs_mwl.xml @@ -1,14 +1,14 @@ - + - + - + diff --git a/test/Makefile.am b/test/Makefile.am index 2283e04..6907f20 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -82,7 +82,7 @@ check_PROGRAMS = test_GSupport \ # Set test environment (needed for linking with cfitsio and readline) TESTS_ENVIRONMENT = @RUNSHARED@=$(top_builddir)/src/.libs$(TEST_ENV_DIR):$(@RUNSHARED@) \ $(TEST_PYTHON_ENV) \ - GAMMALIB_SOURCE=$(abs_top_srcdir) + PACKAGE_SOURCE=$(PACKAGE_SOURCE) # Tests (these are the tests to be executed) TESTS = test_GSupport \ @@ -182,7 +182,7 @@ test_GObservation_LDADD = $(top_srcdir)/src/libgamma.la # Add Valgrind rule # valgrind: - @export GAMMALIB_SOURCE=$(abs_top_srcdir) ; \ + @export PACKAGE_SOURCE=$(PACKAGE_SOURCE) ; \ if type valgrind >/dev/null 2>&1; then \ cd .. ; \ ln -s test/data data ; \ -- libgit2 0.21.4