"Set GMX_BUILD_HELP=OFF or do an out-of-source build to proceed.")
endif()
+if (GMX_BUILD_FOR_COVERAGE)
+ # Set flags for coverage build here instead having to do so manually
+ set(CMAKE_C_FLAGS "-g --coverage")
+ set(CMAKE_CXX_FLAGS "-g --coverage")
+endif()
+
# # # # # # # # # # NO MORE TESTS AFTER THIS LINE! # # # # # # # # # # #
# these are set after everything else
if (NOT GMX_SKIP_DEFAULT_CFLAGS)
#Simpler to always install.
install(FILES COPYING DESTINATION ${GMX_INSTALL_GMXDATADIR} COMPONENT data)
-if (GMX_BUILD_FOR_COVERAGE)
- # Code heavy with asserts makes conditional coverage close to useless metric,
- # as by design most of the false branches are impossible to trigger in
- # correctly functioning code. And the benefit of testing those that could
- # be triggered by using an API against its specification isn't usually
- # worth the effort.
- add_definitions(-DNDEBUG -DGMX_DISABLE_ASSERTS)
-endif()
-
if (BUILD_TESTING)
include(tests/CheckTarget.cmake)
endif()
--- /dev/null
+# Test goal: code coverage with newest GCC
+# Test intents (should change rarely and conservatively):
+# OS: Ubuntu newest supported
+# Compiler: GCC newest supported
+# GPU: no
+# Scope: configure, build, unit tests, coverage
+# Test implementation choices (free to change as needed):
+# OS: Ubuntu 20.04
+# Build type: Debug
+# Compiler: GCC 10
+# MPI: thread_MPI
+# SIMD: AVX2_256
+# Parallelism nt/ntomp: 4/2 (unit tests)
+
+gromacs:gcc-10:coverage:configure:
+ extends:
+ - .gromacs:base:configure
+ - .use-gcc:base
+ - .rules:post-merge-acceptance
+ image: ${CI_REGISTRY}/gromacs/gromacs/ci-ubuntu-20.04-gcc-10
+ variables:
+ CMAKE: /usr/local/cmake-3.18.4/bin/cmake
+ CMAKE_SIMD_OPTIONS: "-DGMX_SIMD=AVX2_256"
+ CMAKE_EXTRA_OPTIONS: "-DGMX_BUILD_FOR_COVERAGE=ON"
+ COMPILER_MAJOR_VERSION: 10
+
+gromacs:gcc-10:coverage:build:
+ extends:
+ - .variables:default
+ - .gromacs:base:build
+ - .before_script:default
+ - .use-ccache
+ - .rules:post-merge-acceptance
+ image: ${CI_REGISTRY}/gromacs/gromacs/ci-ubuntu-20.04-gcc-10
+ variables:
+ CMAKE: /usr/local/cmake-3.18.4/bin/cmake
+ needs:
+ - job: gromacs:gcc-10:coverage:configure
+
+gromacs:gcc-10:coverage:test:
+ extends:
+ - .gromacs:base:test
+ - .rules:post-merge-acceptance
+ image: ${CI_REGISTRY}/gromacs/gromacs/ci-ubuntu-20.04-gcc-10
+ variables:
+ CMAKE: /usr/local/cmake-3.18.4/bin/cmake
+ tags:
+ - k8s-scilifelab
+ needs:
+ - job: gromacs:gcc-10:coverage:build
+ artifacts:
+ paths:
+ - $BUILD_DIR
+
+gromacs:coverage:analyse:
+ variables:
+ CMAKE: /usr/local/cmake-3.18.4/bin/cmake
+ VENVPATH: "/root/venv/py3.7"
+ GCOVR_GENERAL_OPTIONS: "-r ../ /. --gcov-executable=gcov-10 --exclude-unreachable-branches --exclude-throw-branches -j$KUBERNETES_CPU_LIMIT"
+ GCOVR_EXCLUDE_OPTIONS: "--exclude-directories '^src/external/.*' --exclude-directories '^src/gromacs/selection/.*' --exclude-directories '.*tests.*"
+ extends:
+ - .variables:default
+ - .rules:post-merge-acceptance
+ stage: post-test
+ image: ${CI_REGISTRY}/gromacs/gromacs/ci-ubuntu-20.04-gcc-10
+ needs:
+ - job: gromacs:gcc-10:coverage:build
+ - job: gromacs:gcc-10:coverage:test
+
+ tags:
+ - k8s-scilifelab
+ script:
+ - echo ${GCOVR_GENERAL_OPTIONS}
+ - echo ${GCOVR_EXCLUDE_OPTIONS}
+ - source $VENVPATH/bin/activate
+ - mkdir public
+ - outputdir=`pwd`/public
+ - cd $BUILD_DIR
+ # run gcovr to write to stdout for GitLab pipeline grep.
+ - gcovr ${GCOVR_GENERAL_OPTIONS} ${GCOVR_EXCLUDE_OPTIONS}
+ # run gcovr to generate xml output. keep the generated files to produce the html output later.
+ # the invocations need to be separate due to a crash in gcovr where files can not be found.
+ - gcovr ${GCOVR_GENERAL_OPTIONS} ${GCOVR_EXCLUDE_OPTIONS} --xml $outputdir/cobertura-coverage.xml --xml-pretty --keep
+ # final gcovr run, using the generated files to produce nice looking html output
+ - gcovr ${GCOVR_GENERAL_OPTIONS} ${GCOVR_EXCLUDE_OPTIONS} --html $outputdir/coverage.html --use-gcov-files
+ artifacts:
+ paths:
+ - public/
+ reports:
+ cobertura: public/cobertura-coverage.xml