diff --git a/.gitignore b/.gitignore index 3a53eaa50..7dd72dc48 100644 --- a/.gitignore +++ b/.gitignore @@ -1,25 +1,26 @@ build* .dir-locals.el TAGS third-party/*/ !third-party/cmake/* !third-party/akantu-iterators !third-party/iohelper *~ release .*.swp *.tar.gz *.tgz *.tbz *.tar.bz2 .idea __pycache__ .mailmap paraview/* *.vtu *.pvd *.pvtu *.vtk compile_commands.json .clangd .iwyu.imp +.cache diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index b0c336627..b0915a978 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,350 +1,372 @@ stages: - configure - build - check-warnings - test - deploy .docker_build: image: 'docker:19.03.11' stage: .pre services: - docker:19.03.11-dind variables: # Use TLS https://docs.gitlab.com/ee/ci/docker/using_docker_build.html#tls-enabled DOCKER_HOST: tcp://docker:2376 DOCKER_TLS_CERTDIR: "/certs" before_script: - docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY script: - cd test/ci/${IMAGE_NAME}/ - docker build -t registry.gitlab.com/akantu/akantu/${IMAGE_NAME} . - docker push registry.gitlab.com/akantu/akantu/${IMAGE_NAME} docker build:debian-testing: variables: IMAGE_NAME: debian:testing extends: .docker_build rules: - changes: - test/ci/debian:testing/Dockerfile docker build:ubuntu-lts: variables: IMAGE_NAME: ubuntu:lts extends: .docker_build rules: - changes: - test/ci/ubuntu:lts/Dockerfile .configure: stage: configure except: - tags variables: BLA_VENDOR: 'Generic' script: - cmake -E make_directory build - cd build - cmake -DAKANTU_COHESIVE_ELEMENT:BOOL=TRUE -DAKANTU_IMPLICIT:BOOL=TRUE -DAKANTU_PARALLEL:BOOL=TRUE -DAKANTU_STRUCTURAL_MECHANICS:BOOL=TRUE -DAKANTU_HEAT_TRANSFER:BOOL=TRUE -DAKANTU_DAMAGE_NON_LOCAL:BOOL=TRUE -DAKANTU_PHASE_FIELD:BOOL=TRUE -DAKANTU_PYTHON_INTERFACE:BOOL=TRUE -DAKANTU_CONTACT_MECHANICS:BOOL=TRUE -DAKANTU_EXAMPLES:BOOL=TRUE -DAKANTU_BUILD_ALL_EXAMPLES:BOOL=TRUE - -DAKANTU_TEST_EXAMPLES:BOOL=TRUE -DAKANTU_TESTS:BOOL=TRUE -DAKANTU_RUN_IN_DOCKER:BOOL=TRUE - -DCMAKE_BUILD_TYPE:STRING=Coverage .. + -DAKANTU_TEST_EXAMPLES:BOOL=${TEST_EXAMPLES} + -DCMAKE_BUILD_TYPE:STRING=${BUILD_TYPE} .. - cp compile_commmands.json .. artifacts: when: on_success paths: - build - compile_commands.json expire_in: 10h .build: stage: build script: - cmake --build build/src > >(tee -a ${output}-out.log) 2> >(tee -a ${output}-err.log >&2) - cmake --build build/python > >(tee -a ${output}-out.log) 2> >(tee -a ${output}-err.log >&2) - cmake --build build/test/ > >(tee -a ${output}-out.log) 2> >(tee -a ${output}-err.log >&2) - cmake --build build/examples > >(tee -a ${output}-out.log) 2> >(tee -a ${output}-err.log >&2) artifacts: when: on_success paths: - build/ - #- ${output}-out.log - ${output}-err.log - compile_commands.json expire_in: 10h .tests: stage: test script: - cd build - ctest -T test --no-compress-output --timeout 1800 after_script: - cd build - tag=$(head -n 1 < Testing/TAG) - if [ -e Testing/${tag}/Test.xml ]; then - xsltproc -o ./juint.xml ${CI_PROJECT_DIR}/test/ci/ctest2junit.xsl Testing/${tag}/Test.xml; - fi - - gcovr --xml - --gcov-executable "${GCOV_EXECUTABLE}" - --output coverage.xml - --object-directory ${CI_PROJECT_DIR}/build - --root ${CI_PROJECT_DIR} -s || true + - if [ ${CMAKE_BUILD_TYPE} = "Coverage" ] + - gcovr --xml + --gcov-executable "${GCOV_EXECUTABLE}" + --output coverage.xml + --object-directory ${CI_PROJECT_DIR}/build + --root ${CI_PROJECT_DIR} -s || true + - fi artifacts: when: always paths: - build/juint.xml - build/coverage.xml reports: junit: - build/juint.xml cobertura: - build/coverage.xml -.analyse_build: +.analyze_build: stage: check-warnings script: - if [[ $(cat ${output}-err.log | grep warning -i) ]]; then - cat ${output}-err.log; - exit 1; - fi allow_failure: true artifacts: when: on_failure paths: - "$output-err.log" # ------------------------------------------------------------------------------ .cache_build: variables: CCACHE_BASEDIR: ${CI_PROJECT_DIR}/build CCACHE_DIR: ${CI_PROJECT_DIR}/.ccache CCACHE_NOHASHDIR: 1 CCACHE_COMPILERCHECK: content cache: key: ${output} policy: pull-push paths: - .ccache/ - third-party/google-test - third-party/pybind11 before_script: - ccache --zero-stats || true after_script: - ccache --show-stats || true # ------------------------------------------------------------------------------ .image_debian_testing: image: registry.gitlab.com/akantu/akantu/debian:testing .image_ubuntu_lts: image: registry.gitlab.com/akantu/akantu/ubuntu:lts # ------------------------------------------------------------------------------ .compiler_gcc: variables: CC: /usr/lib/ccache/gcc CXX: /usr/lib/ccache/g++ FC: gfortran GCOV_EXECUTABLE: gcov .compiler_clang: variables: CC: /usr/lib/ccache/clang CXX: /usr/lib/ccache/clang++ FC: gfortran GCOV_EXECUTABLE: llvm-cov gcov +.coverage: + variables: + BUILD_TYPE: Coverage + TEST_EXAMPLE: FALSE + +.release: + variables: + BUILD_TYPE: Release + TEST_EXAMPLE: TRUE + +.valgrind: + variables: + BUILD_TYPE: Valgrind + TEST_EXAMPLE: FALSE + # ------------------------------------------------------------------------------ .debian_testing_gcc: variables: output: debian_testing_gcc extends: - .compiler_gcc - .image_debian_testing - .cache_build .debian_testing_clang: variables: output: debian_testing_clang extends: - .compiler_clang - .image_debian_testing - .cache_build .ubuntu_lts_gcc: variables: output: ubuntu_lts_gcc extends: - .compiler_gcc - .image_ubuntu_lts - .cache_build # ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------ configure:debian_testing_gcc: extends: - .debian_testing_gcc + - .coverage - .configure cache: policy: pull-push build:debian_testing_gcc: extends: - .debian_testing_gcc + - .coverage - .build - dependencies: - - configure:debian_testing_gcc + needs: + - job: configure:debian_testing_gcc + artifact: true test:debian_testing_gcc: extends: - .debian_testing_gcc + - .coverage - .tests - dependencies: - - build:debian_testing_gcc + needs: + - job: build:debian_testing_gcc + artifact: true -analyse_build:debian_testing_gcc: +analyze_build:debian_testing_gcc: extends: - .debian_testing_gcc - - .analyse_build - dependencies: - - build:debian_testing_gcc + - .analyze_build + needs: + - job: build:debian_testing_gcc + artifact: true # ------------------------------------------------------------------------------ configure:debian_testing_clang: extends: - .debian_testing_clang + - .coverage - .configure cache: policy: pull-push build:debian_testing_clang: extends: - .debian_testing_clang + - .coverage - .build - dependencies: - - configure:debian_testing_clang + needs: + - job: configure:debian_testing_clang + artifact: true test:debian_testing_clang: extends: - .debian_testing_clang + - .coverage - .tests - dependencies: - - build:debian_testing_clang + needs: + - job: build:debian_testing_clang + artifact: true -analyse_build:debian_testing_clang: +analyze_build:debian_testing_clang: extends: - .debian_testing_clang - - .analyse_build - dependencies: - - build:debian_testing_clang + - .coverage + - .analyze_build + needs: + - job: build:debian_testing_clang + artifact: true # ------------------------------------------------------------------------------ configure:ubuntu_lts_gcc: extends: - .ubuntu_lts_gcc + - .release - .configure cache: policy: pull-push build:ubuntu_lts_gcc: extends: - .ubuntu_lts_gcc + - .release - .build - dependencies: - - configure:ubuntu_lts_gcc + needs: + - job: configure:ubuntu_lts_gcc + artifact: true -analyse_build:ubuntu_lts_gcc: +analyze_build:ubuntu_lts_gcc: extends: - .ubuntu_lts_gcc - - .analyse_build - dependencies: - - build:ubuntu_lts_gcc + - .release + - .analyze_build + needs: + - job: build:ubuntu_lts_gcc + artifact: true test:ubuntu_lts_gcc: extends: - .ubuntu_lts_gcc + - .release - .tests - dependencies: - - build:ubuntu_lts_gcc + needs: + - job: build:ubuntu_lts_gcc + artifact: true # ------------------------------------------------------------------------------ +include: + - template: Code-Quality.gitlab-ci.yml + code_quality: + needs: + - job: build:debian_testing_clang + artifact: true + artifacts: + paths: [gl-code-quality-report.json] + +lint: stage: test - image: docker:19.03.12 - allow_failure: true - services: - - docker:19.03.12-dind - variables: - DOCKER_DRIVER: overlay2 - DOCKER_HOST: tcp://docker:2376 - DOCKER_TLS_CERTDIR: "/certs" - CODECLIMATE_DEV: 1 - CODE_QUALITY_IMAGE: "registry.gitlab.com/gitlab-org/ci-cd/codequality:0.85.22" - needs: [] + extends: + - .debian_testing_clang script: - - export SOURCE_CODE=$PWD - - | # this is required to avoid undesirable reset of Docker image ENV variables being set on build stage - function propagate_env_vars() { - CURRENT_ENV=$(printenv) - for VAR_NAME; do - echo $CURRENT_ENV | grep "${VAR_NAME}=" > /dev/null && echo "--env $VAR_NAME " - done - } - - docker pull --quiet "$CODE_QUALITY_IMAGE" - - | - - docker build -t codeclimate/codeclimate-clang-tidy test/ci/codeclimate/codeclimate-clang-tidy - - | - docker run \ - $(propagate_env_vars \ - SOURCE_CODE \ - TIMEOUT_SECONDS \ - CODECLIMATE_DEBUG \ - CODECLIMATE_DEV \ - REPORT_STDOUT \ - REPORT_FORMAT \ - ENGINE_MEMORY_LIMIT_BYTES \ - ) \ - --volume "$PWD":/code \ - --volume /var/run/docker.sock:/var/run/docker.sock \ - "$CODE_QUALITY_IMAGE" /code + - test/ci/scripts/clang-tidy2code-quality.py + -p ${CI_PROJECT_DIR}/compile_commands.json + ${CI_PROJECT_DIR}/src + ${CI_PROJECT_DIR}/test + ${CI_PROJECT_DIR}/examples > clang-tidy-report.json + needs: + - job: build:debian_testing_clang + artifact: true + allow_failure: true artifacts: paths: - - gl-code-quality-report.json + - clang-tidy-report.json + artifacts: reports: - codequality: gl-code-quality-report.json - expire_in: 1 week - dependencies: [] + codequality: clang-tidy-report.json rules: - if: '$CODE_QUALITY_DISABLED' when: never - if: '$CI_COMMIT_TAG || $CI_COMMIT_BRANCH' + # ------------------------------------------------------------------------------ pages: stage: deploy extends: - .debian_testing_gcc script: - cd build - cmake -DAKANTU_DOCUMENTATION=ON .. - cmake --build . -t sphinx-doc - mv doc/dev-doc/html ../public - dependencies: - - build:debian_testing_gcc + needs: + - job: build:debian_testing_gcc + artifact: true artifacts: paths: - public only: - master diff --git a/cmake/AkantuExtraCompilationProfiles.cmake b/cmake/AkantuExtraCompilationProfiles.cmake index c39ff7480..2fea3c84f 100644 --- a/cmake/AkantuExtraCompilationProfiles.cmake +++ b/cmake/AkantuExtraCompilationProfiles.cmake @@ -1,143 +1,119 @@ #=============================================================================== # @file AkantuExtraCompilationProfiles.cmake # # @author Nicolas Richart # # @date creation: Fri Dec 02 2016 # @date last modification: Wed Feb 03 2021 # # @brief Compilation profiles # # # @section LICENSE # # Copyright (©) 2016-2021 EPFL (Ecole Polytechnique Fédérale de Lausanne) # Laboratory (LSMS - Laboratoire de Simulation en Mécanique des Solides) # # Akantu is free software: you can redistribute it and/or modify it under the # terms of the GNU Lesser General Public License as published by the Free # Software Foundation, either version 3 of the License, or (at your option) any # later version. # # Akantu is distributed in the hope that it will be useful, but WITHOUT ANY # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR # A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more # details. # # You should have received a copy of the GNU Lesser General Public License along # with Akantu. If not, see . # #=============================================================================== option (FORCE_COLORED_OUTPUT "Always produce ANSI-colored output (GNU/Clang only)." FALSE) mark_as_advanced(FORCE_COLORED_OUTPUT) if(FORCE_COLORED_OUTPUT) if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang") add_flags(cxx "-fcolor-diagnostics") else() add_flags(cxx "-fdiagnostics-color=always") endif() endif() + set(CMAKE_CXX_FLAGS_RELEASE "-O3 -DNDEBUG -DAKANTU_NDEBUG" CACHE STRING "Flags used by the compiler during release builds" FORCE) if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" OR CMAKE_CXX_COMPILER_ID STREQUAL "Clang") set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG_INIT} -ggdb3" CACHE STRING "Flags used by the compiler during debug builds" FORCE) set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO_INIT} -ggdb3" CACHE STRING "Flags used by the compiler during debug builds" FORCE) endif() -#Profiling -set(_profiling "-g -ggdb3 -pg -DNDEBUG -DAKANTU_NDEBUG -O2") -set(CMAKE_CXX_FLAGS_PROFILING ${_profiling} - CACHE STRING "Flags used by the compiler during profiling builds") -set(CMAKE_C_FLAGS_PROFILING ${_profiling} - CACHE STRING "Flags used by the compiler during profiling builds") -set(CMAKE_Fortran_FLAGS_PROFILING ${_profiling} - CACHE STRING "Flags used by the compiler during profiling builds") -set(CMAKE_EXE_LINKER_FLAGS_PROFILING "-pg" - CACHE STRING "Flags used by the linker during profiling builds") -set(CMAKE_SHARED_LINKER_FLAGS_PROFILING "-pg" - CACHE STRING "Flags used by the linker during profiling builds") - -mark_as_advanced( - CMAKE_CXX_FLAGS_PROFILING - CMAKE_C_FLAGS_PROFILING - CMAKE_Fortran_FLAGS_PROFILING - CMAKE_EXE_LINKER_FLAGS_PROFILING - CMAKE_SHARED_LINKER_FLAGS_PROFILING - ) - -set(_coverage "-g -ggdb3 -DNDEBUG -DAKANTU_NDEBUG -O2 --coverage") -set(CMAKE_CXX_FLAGS_COVERAGE ${_coverage} - CACHE STRING "Flags used by the compiler during profiling builds" FORCE) -set(CMAKE_C_FLAGS_COVERAGE ${_coverage} - CACHE STRING "Flags used by the compiler during profiling builds" FORCE) -set(CMAKE_Fortran_FLAGS_COVERAGE ${_coverage} - CACHE STRING "Flags used by the compiler during profiling builds" FORCE) -set(CMAKE_SHARED_LINKER_FLAGS_COVERAGE ${_coverage} - CACHE STRING "Flags used by the compiler during profiling builds" FORCE) -set(CMAKE_EXE_LINKER_FLAGS_COVERAGE ${_coverage} - CACHE STRING "Flags used by the linker during sanitizing builds" FORCE) - -mark_as_advanced( - CMAKE_CXX_FLAGS_COVERAGE - CMAKE_C_FLAGS_COVERAGE - CMAKE_Fortran_FLAGS_COVERAGE - CMAKE_SHARED_LINKER_FLAGS_COVERAGE - CMAKE_EXE_LINKER_FLAGS_COVERAGE - ) +function(declare_compilation_profile name) + include(CMakeParseArguments) + + cmake_parse_arguments(_args + "" "COMPILER;LINKER;DOC" "" ${ARGN}) + + string(TOUPPER "${name}" _u_name) + + if(NOT _args_DOC) + string(TOLOWER "${name}" _args_DOC) + endif() + + if(NOT _args_COMPILER) + message(FATAL_ERROR "declare_compilation_profile: you should at least give COMPILER flags") + endif() + + if(NOT _args_LINKER) + set(_args_LINKER ${_args_COMPILER}) + endif() + + foreach(_flag CXX C Fortran SHARED_LINKER EXE_LINKER) + set(_stage "compiler") + set(_flags ${_args_COMPILER}) + if(_stage MATCHES ".*LINKER") + set(_stage "linker") + set(_flags ${_args_LINKER}) + endif() + set(CMAKE_${_flag}_FLAGS_${_u_name} ${_flags} + CACHE STRING "Flags used by the ${_stage} during coverage builds" FORCE) + mark_as_advanced(CMAKE_${_flag}_FLAGS_${_u_name}) + endforeach() +endfunction() + + +# Profiling +declare_compilation_profile(PROFILING + COMPILER "-g -ggdb3 -pg -DNDEBUG -DAKANTU_NDEBUG -O2") + +# Valgrind +declare_compilation_profile(VALGRIND + COMPILER "-g -ggdb3 -pg -DNDEBUG -DAKANTU_NDEBUG -O2") + +# Coverage +declare_compilation_profile(COVERAGE + COMPILER "-g -ggdb3 -DNDEBUG -DAKANTU_NDEBUG -O2 --coverage") # Sanitize the code if ((CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER "5.2") OR CMAKE_CXX_COMPILER_ID STREQUAL "Clang") if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang") set(_blacklist " -fsanitize-blacklist=${PROJECT_SOURCE_DIR}/cmake/sanitize-blacklist.txt") endif() - set(_sanitize "-g -ggdb3 -O2 -fsanitize=address -fsanitize=leak -fsanitize=undefined -fno-omit-frame-pointer${_blacklist}") - - set(CMAKE_CXX_FLAGS_SANITIZE ${_sanitize} - CACHE STRING "Flags used by the compiler during sanitizing builds") - set(CMAKE_C_FLAGS_SANITIZE ${_sanitize} - CACHE STRING "Flags used by the compiler during sanitizing builds") - set(CMAKE_Fortran_FLAGS_SANITIZE ${_sanitize} - CACHE STRING "Flags used by the compiler during sanitizing builds") - set(CMAKE_EXE_LINKER_FLAGS_SANITIZE ${_sanitize} - CACHE STRING "Flags used by the linker during sanitizing builds") - set(CMAKE_SHARED_LINKER_FLAGS_SANITIZE ${_sanitize} - CACHE STRING "Flags used by the linker during sanitizing builds") - - mark_as_advanced( - CMAKE_CXX_FLAGS_SANITIZE - CMAKE_C_FLAGS_SANITIZE - CMAKE_Fortran_FLAGS_SANITIZE - CMAKE_SHARED_LINKER_FLAGS_SANITIZE - CMAKE_EXE_LINKER_FLAGS_SANITIZE - ) + + declare_compilation_profile(SANITIZE + COMPILER "-g -ggdb3 -O2 -fsanitize=address -fsanitize=leak -fsanitize=undefined -fno-omit-frame-pointer${_blacklist}") endif() if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang") - set(_sanitize "-g -ggdb3 -O2 -fPIE -fsanitize=memory -fsanitize-memory-track-origins -fsanitize-recover=all -fno-omit-frame-pointer -fsanitize-blacklist=${PROJECT_SOURCE_DIR}/cmake/sanitize-blacklist.txt") - - set(CMAKE_CXX_FLAGS_SANITIZEMEMORY ${_sanitize} - CACHE STRING "Flags used by the compiler during sanitizing builds") - set(CMAKE_C_FLAGS_SANITIZEMEMORY ${_sanitize} - CACHE STRING "Flags used by the compiler during sanitizing builds") - set(CMAKE_Fortran_FLAGS_SANITIZEMEMORY ${_sanitize} - CACHE STRING "Flags used by the compiler during sanitizing builds") - set(CMAKE_EXE_LINKER_FLAGS_SANITIZEMEMORY ${_sanitize} - CACHE STRING "Flags used by the linker during sanitizing builds") - set(CMAKE_SHARED_LINKER_FLAGS_SANITIZEMEMORY ${_sanitize} - CACHE STRING "Flags used by the linker during sanitizing builds") - - mark_as_advanced( - CMAKE_CXX_FLAGS_SANITIZEMEMORY - CMAKE_C_FLAGS_SANITIZEMEMORY - CMAKE_Fortran_FLAGS_SANITIZEMEMORY - CMAKE_SHARED_LINKER_FLAGS_SANITIZEMEMORY - CMAKE_EXE_LINKER_FLAGS_SANITIZEMEMORY - ) + declare_compilation_profile(SANITIZEMEMORY + COMPILER "-g -ggdb3 -O2 -fPIE -fsanitize=memory -fsanitize-memory-track-origins -fsanitize-recover=all -fno-omit-frame-pointer -fsanitize-blacklist=${PROJECT_SOURCE_DIR}/cmake/sanitize-blacklist.txt" + DOC "\"sanitize memory\"") +endif() + +if (CMAKE_BUILD_TYPE MATCHES "[Vv][Aa][Ll][Gg][Rr][Ii][Nn][Dd]") + find_program(VALGRIND_EXECUTABLE valgrind) endif() diff --git a/cmake/AkantuTestsMacros.cmake b/cmake/AkantuTestsMacros.cmake index 5103e28cb..dbba20663 100644 --- a/cmake/AkantuTestsMacros.cmake +++ b/cmake/AkantuTestsMacros.cmake @@ -1,653 +1,657 @@ #=============================================================================== # @file AkantuTestsMacros.cmake # # @author Nicolas Richart # # @date creation: Fri Sep 03 2010 # @date last modification: Tue Jun 30 2020 # # @brief macros for tests # # # @section LICENSE # # Copyright (©) 2010-2021 EPFL (Ecole Polytechnique Fédérale de Lausanne) # Laboratory (LSMS - Laboratoire de Simulation en Mécanique des Solides) # # Akantu is free software: you can redistribute it and/or modify it under the # terms of the GNU Lesser General Public License as published by the Free # Software Foundation, either version 3 of the License, or (at your option) any # later version. # # Akantu is distributed in the hope that it will be useful, but WITHOUT ANY # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR # A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more # details. # # You should have received a copy of the GNU Lesser General Public License along # with Akantu. If not, see . # #=============================================================================== #[=======================================================================[.rst: AkantuTestsMacros ----------------- This modules provides the functions to helper to declare tests and folders containing tests in akantu .. command:: add_test_tree add_test_tree() ```` is the entry direcroty of the full structure of subfolders containing tests .. command:: add_akantu_test add_akantu_test( ) This function add a subdirectory ```` of tests that will be conditionnaly activable and will be visible only if the parent folder as been activated An option ``AKANTU_BUILD_TEST_`` will appear in ccmake with the description ````. The compilation of all tests can be forced with the option ``AKANTU_BUILD_ALL_TESTS`` .. command:: register_test register_test( SOURCES ... PACKAGE ... SCRIPT [FILES_TO_COPY ...] [DEPENDS ...] [DIRECTORIES_TO_CREATE ...] [COMPILE_OPTIONS ...] [EXTRA_FILES ...] [LINK_LIBRARIES ...] [INCLUDE_DIRECTORIES ...] [UNSABLE] [PARALLEL] [PARALLEL_LEVEL ...] ) This function defines a test ``_run`` this test could be of different nature depending on the context. If Just sources are provided the test consist of running the executable generated. If a file ``.sh`` is present the test will execute the script. And if a ``.verified`` exists the output of the test will be compared to this reference file The options are: ``SOURCES ...`` The list of source files to compile to generate the executable of the test ``PACKAGE ...`` The list of package to which this test belongs. The test will be activable only of all the packages listed are activated ``SCRIPT