Skip to content
Snippets Groups Projects
Commit f54e3842 authored by Soeren Peters's avatar Soeren Peters
Browse files

Merge pull request 'feature/gcov' (#55) from peters/VirtualFluids_dev:feature/gcov into develop

Reviewed-on: https://git.irmb.bau.tu-bs.de/VirtualFluids/VirtualFluids_dev/pulls/55
parents 847d7c56 78be42a5
No related branches found
No related tags found
No related merge requests found
......@@ -226,3 +226,52 @@ lizard:
artifacts:
paths:
- lizard.txt
# code coverage
gcov:
stage: test
only: ["schedules"]
before_script:
- export DEBIAN_FRONTEND=noninteractive
- apt-get update
- pip3 install gcovr
- gcovr --version
script:
- mkdir $CI_PROJECT_DIR/build
- cd $CI_PROJECT_DIR/build
- cmake .. -DBUILD_VF_CPU=ON -DBUILD_VF_COVERAGE=ON -DBUILD_VF_UNIT_TESTS=ON
- make -j4
- ./bin/basicsTests
- cd ..
- mkdir coverage
- gcovr -r $CI_PROJECT_DIR -k build -f "src" --print-summary --html coverage/coverage.html --html-details --xml coverage/coverage.xml
artifacts:
paths:
- coverage/
reports:
cobertura: coverage/coverage.xml
deploy_gcov_to_elladan:
stage: deploy
only: ["schedules"]
needs: ["gcov"]
before_script:
- 'command -v ssh-agent >/dev/null || ( apt-get update -y && apt-get install openssh-client -y )'
- apt-get install -y rsync
- mkdir -p ~/.ssh
- chmod 700 ~/.ssh
- eval $(ssh-agent -s)
- echo "$SSH_PRIVATE_KEY_ELLADAN" | tr -d '\r' | ssh-add -
- ssh-keyscan -t rsa elladan.irmb.bau.tu-bs.de >> ~/.ssh/known_hosts
- pip3 install ansible
script:
- ansible-playbook -i ansible/hosts.cfg -u public_pages ansible/playbook_gcov.yml
\ No newline at end of file
......@@ -267,6 +267,9 @@ function(vf_add_tests)
target_include_directories(${library_test_name} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})
target_include_directories(${library_test_name} PRIVATE ${VF_SRC_DIR})
# flags
addAdditionalFlags(${library_test_name})
# link googlemock
linkGMOCK()
......
......@@ -16,6 +16,12 @@ if(NOT BUILD_VF_INCLUDE_WHAT_YOU_USE) # optimization flag '-funroll-all-loops' i
LIST(APPEND CAB_COMPILER_ADDTIONAL_CXX_COMPILER_FLAGS "-funroll-all-loops")
endif()
# gcov
if (BUILD_VF_COVERAGE)
list(APPEND CAB_COMPILER_ADDTIONAL_CXX_COMPILER_FLAGS "--coverage")
set(CMAKE_EXE_LINKER_FLAGS ${CMAKE_EXE_LINKER_FLAGS} " --coverage")
endif()
#############################################################################################################
# warnings
#############################################################################################################
......
......@@ -41,11 +41,14 @@ option(BUILD_VF_UNIT_TESTS "Build VirtualFluids unit tests" OFF)
option(BUILD_VF_CLANG_TIDY "Add the clang tidy checks to the targets" OFF)
option(BUILD_VF_INCLUDE_WHAT_YOU_USE "Add IWYU to the targets" OFF)
option(BUILD_VF_CPPCHECK "Add cppcheck to the targets" OFF)
option(BUILD_VF_COVERAGE "Add the -coverage compiler flag." OFF)
option(BUILD_SHARED_LIBS "" ON)
option(USE_OPENMP "Include OpenMP support" ON)
option(BUILD_VF_PYTHON_BINDINGS "" OFF)
#################################################################################
# CMAKE POLICIES
#################################################################################
......
......@@ -4,3 +4,5 @@ host_key_checking=False
phoenix.hlr.rz.tu-bs.de ansible_ssh_private_key_file=./private_key
[gitlab_ci_deploy_cppcheck]
elladan.irmb.bau.tu-bs.de
[gitlab_ci_deploy_gcov]
elladan.irmb.bau.tu-bs.de
\ No newline at end of file
......@@ -7,4 +7,4 @@
- name: Synchronize cppcheck with remote
synchronize:
src: "../html_report"
dest: "~/cppcheck/html_report"
dest: "~/cppcheck"
- hosts: gitlab_ci_deploy_gcov
tasks:
- name: Create remote gcov dir
command: mkdir ~/gcov
ignore_errors: yes
- name: Synchronize gcov with remote
synchronize:
src: "../coverage"
dest: "~/gcov"
......@@ -85,8 +85,11 @@ add_subdirectory(${VF_THIRD_DIR}/MuParser)
add_subdirectory(${VF_THIRD_DIR}/pybind11/pybind11-2.5.0)
add_subdirectory(src/cpu/VirtualFluidsCore)
add_subdirectory(src/cpu/simulationconfig)
add_subdirectory(src/cpu/pythonbindings)
if(BUILD_VF_PYTHON_BINDINGS)
add_subdirectory(src/cpu/simulationconfig)
add_subdirectory(src/cpu/pythonbindings)
endif()
set (APPS_ROOT_CPU "${VF_ROOT_DIR}/apps/cpu/")
include(${APPS_ROOT_CPU}/Applications.cmake)
\ No newline at end of file
from skbuild import setup
cmake_args = ["-DBUILD_VF_CPU:BOOL=ON", "-DUSE_METIS=ON", "-DUSE_MPI=ON", "-DBUILD_SHARED_LIBS=OFF",
cmake_args = ["-DBUILD_VF_CPU:BOOL=ON", "-DUSE_METIS=ON", "-DUSE_MPI=ON", "-DBUILD_SHARED_LIBS=OFF", "-DBUILD_VF_PYTHON_BINDINGS=ON",
"-DBUILD_VF_UNIT_TESTS:BOOL=ON"]
setup(
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment