From 2d0ec436499cdb4fe668377675abccf6ba8fbd74 Mon Sep 17 00:00:00 2001 From: Jürgen Knödlseder Date: Tue, 15 Mar 2016 09:47:45 +0100 Subject: [PATCH] Add --branch option to Python coverage tool and forward also --coverage option for SWIG interface compilation. --- configure.ac | 7 +++++-- cscripts/cslightcrv.py | 15 +++++++++++---- pyext/setup.py.in | 4 ++-- 3 files changed, 18 insertions(+), 8 deletions(-) diff --git a/configure.ac b/configure.ac index 4b03958..1468f4f 100644 --- a/configure.ac +++ b/configure.ac @@ -758,6 +758,7 @@ fi ############################################################################# # Initialise Python coverage with empty string PYTHON_COVERAGE= +COVERAGE_CXXFLAGS= # Check for coverage option AC_MSG_CHECKING(whether to build ctools for code coverage measure) @@ -768,15 +769,17 @@ AC_ARG_ENABLE([coverage], [enable_coverage="no"]) if test "x$enable_coverage" = "xyes"; then CXXFLAGS="--coverage $CXXFLAGS" + COVERAGE_CXXFLAGS="--coverage" LDFLAGS="--coverage $LDFLAGS" if test "x$has_python" = "xyes"; then - PYTHON_COVERAGE="coverage run --append " + PYTHON_COVERAGE="coverage run --branch --append " fi AC_MSG_RESULT(yes) else AC_MSG_RESULT(no) fi AC_SUBST(PYTHON_COVERAGE) +AC_SUBST(COVERAGE_CXXFLAGS) ############################################################################# @@ -937,7 +940,7 @@ OPENMP_LIB_LDFLAGS= #fi AC_SUBST(OPENMP_LIB_LDFLAGS) -# Signal if ctools cannot be compiled as gammalibe requires OpenMP but ctools +# Signal if ctools cannot be compiled as gammalib requires OpenMP but ctools # cannot be compiled with OpenMP if test "x$enable_openmp" = "xno" && test "x$gammalib_with_openmp" = "xyes"; then AC_MSG_ERROR([The GammaLib library has been built with openMP support but OpenMP is not available on this system. Please install OpenMP or re-build GammaLib without OpenMP support.]) diff --git a/cscripts/cslightcrv.py b/cscripts/cslightcrv.py index 313bc55..a316c83 100755 --- a/cscripts/cslightcrv.py +++ b/cscripts/cslightcrv.py @@ -106,11 +106,18 @@ class cslightcrv(ctools.cscript): # Get time boundaries self._tbins = self._create_tbounds() - # Set stacked analysis flag if the requested number of energy bins - # is not zero; otherwise an unbinned analysis will be done. - self._stacked = False if self["enumbins"].integer() == 0 else True + # Set stacked analysis flag to True if the requested number of + # energy bins is positive. Otherwise an unbinned analysis will + # be done and the stacked analysis flag will be set to False. + if self["enumbins"].integer() > 0: + self._stacked = True + else: + self._stacked = False - # Make sure that other parameters are queried now and not later + # Make sure that remaining user parameters are queried now. We + # do not store the actual parameter values as we do not want + # too many instance attributes with enhances the maintenance + # costs. self["emin"].real() self["emax"].real() if self._stacked: diff --git a/pyext/setup.py.in b/pyext/setup.py.in index 1d45b41..a208baa 100644 --- a/pyext/setup.py.in +++ b/pyext/setup.py.in @@ -108,10 +108,10 @@ data_files=[('@prefix@/share/ctools/swig', install_files)] # Optionally enable OpenMP if '@OPENMP_TRUE@' != '#': - extra_compile_args = ['@OPENMP_CXXFLAGS@'] + extra_compile_args = ['@OPENMP_CXXFLAGS@','@COVERAGE_CXXFLAGS@'] extra_link_args = ['@OPENMP_CXXFLAGS@'] else: - extra_compile_args = [] + extra_compile_args = ['@COVERAGE_CXXFLAGS@'] extra_link_args = [] # Optionally add link flag for El Capitan post-processing of modules -- libgit2 0.21.4