Skip to content

Commit

Permalink
add --with-coverage to control usage of Python coverage tests (#1713)
Browse files Browse the repository at this point in the history
* add --with-coverage to control usage of Python coverage tests

* move  --with-coverage  to correct CI line
  • Loading branch information
stevengj authored Jul 29, 2021
1 parent b07a6ce commit ebaa9f7
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ jobs:
- name: Run configure
if: ${{ matrix.enable-mpi == false && matrix.python-version == 3.6 }}
run: ./configure --enable-maintainer-mode --prefix=${HOME}/local --with-libctl=${HOME}/local/share/libctl ${MPICONF}
run: ./configure --enable-maintainer-mode --with-coverage --prefix=${HOME}/local --with-libctl=${HOME}/local/share/libctl ${MPICONF}

- name: Run configure with single-precision floating point
if: ${{ matrix.enable-mpi == true && matrix.python-version == 3.9 }}
Expand Down
22 changes: 13 additions & 9 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -538,6 +538,9 @@ if test "$USE_MAINTAINER_MODE" = yes && (test "x$with_python" = "xyes" || test "
AC_MSG_ERROR([SWIG not found; configure --without-python --without-scheme or use a release tarball])
fi

AC_ARG_WITH(coverage, [AS_HELP_STRING([--with-coverage],[enable Python coverage tests])],
with_coverage=$withval, with_coverage=no)

if test "x$with_python" = xno; then
have_python=no
else
Expand Down Expand Up @@ -572,14 +575,15 @@ else
AC_MSG_WARN([disabling Python wrappers])
have_python=no],[#include <Python.h>])

AC_MSG_CHECKING([for coverage module])
$PYTHON -c 'import coverage' 2>/dev/null
if test $? = 0; then
AC_MSG_RESULT([yes])
have_coverage=yes
else
AC_MSG_RESULT([no])
have_coverage=no
if test x"$with_coverage" = xyes; then
AC_MSG_CHECKING([for coverage module])
$PYTHON -c 'import coverage' 2>/dev/null
if test $? = 0; then
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no])
with_coverage=no
fi
fi
fi

Expand All @@ -591,7 +595,7 @@ fi # with_python

AC_SUBST(PYTHON_INCLUDES)
AM_CONDITIONAL(WITH_PYTHON, test x"$have_python" = "xyes")
AM_CONDITIONAL(WITH_COVERAGE, test x"$have_coverage" = "xyes")
AM_CONDITIONAL(WITH_COVERAGE, test x"$with_coverage" = "xyes")

if test "x$with_scheme" = xyes; then
# Copy/symlink casimir.scm and materials.scm to builddir for out-of-tree builds
Expand Down

0 comments on commit ebaa9f7

Please sign in to comment.