Skip to content

Commit a033fd1

Browse files
committed
merge upstream changes
2 parents 1befba1 + d09b220 commit a033fd1

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+1531
-3279
lines changed

.github/workflows/docs.yaml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Pages
2+
on:
3+
push:
4+
branches:
5+
- main
6+
jobs:
7+
build:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@v2
11+
- uses: actions/setup-python@v2
12+
with:
13+
python-version: "3.9"
14+
architecture: "x64"
15+
- name: Checkout
16+
uses: actions/checkout@main
17+
with:
18+
fetch-depth: 0 # otherwise, you will failed to push refs to dest repo
19+
- name: build docs
20+
uses: mattnotmitt/[email protected]
21+
with:
22+
doxyfile-path: 'Doxyfile'
23+
- name: Deploy
24+
uses: peaceiris/actions-gh-pages@v3
25+
with:
26+
github_token: ${{ secrets.GITHUB_TOKEN }}
27+
publish_dir: ./docs/doxygen/html

.github/workflows/fdp_cpp_api.yaml

Lines changed: 7 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,10 @@ jobs:
4242
- name: Install Dependencies
4343
run: |
4444
sudo apt update
45-
sudo apt install -y lcov libjsoncpp-dev curl libcurl4-openssl-dev libyaml-cpp-dev libhdf5-dev
45+
sudo apt install -y lcov libjsoncpp-dev curl libcurl4-openssl-dev libyaml-cpp-dev gcovr
4646
- name: Configure Library
4747
run: |
48-
cmake -Bbuild -DFDPAPI_BUILD_TESTS=ON
48+
cmake -Bbuild -DFDPAPI_BUILD_TESTS=ON -DFDPAPI_CODE_COVERAGE=ON -DCMAKE_BUILD_TYPE=Debug
4949
- name: Fetch cache
5050
uses: actions/[email protected]
5151
with:
@@ -60,21 +60,19 @@ jobs:
6060
wget -nv https://sonarcloud.io/static/cpp/build-wrapper-linux-x86.zip
6161
unzip -q build-wrapper-linux-x86.zip
6262
echo "${PWD}/build-wrapper-linux-x86" >> $GITHUB_PATH
63-
- name: Compile FDP-Cpp-API
64-
run: build-wrapper-linux-x86-64 --out-dir bw-outputs cmake --build build
65-
env:
66-
CIBuild: 1
67-
BUILD_TESTS: True
68-
- name: Run Unit Tests
63+
- name: Build and Run Unit Tests
6964
run: |
70-
cmake --build build --target test
65+
build-wrapper-linux-x86-64 --out-dir bw-outputs cmake --build build --target coverage
7166
if [ $? -eq 0 ]; then
7267
echo "Unit tests completed successfully"
7368
exit 0
7469
else
7570
echo "Unit tests failed"
7671
exit 1
7772
fi
73+
env:
74+
CIBuild: 1
75+
BUILD_TESTS: True
7876
- name: SonarCloud Scan
7977
run: |
8078
sonar-scanner -Dsonar.host.url=https://sonarcloud.io -Dsonar.login=$SONAR_TOKEN -X
@@ -91,7 +89,6 @@ jobs:
9189
- name: Install Dependencies
9290
run: |
9391
brew install cmake
94-
brew install hdf5
9592
brew install curl
9693
- name: Configure Library
9794
run: |
@@ -107,20 +104,8 @@ jobs:
107104
steps:
108105
- uses: actions/checkout@v2
109106
- uses: ilammy/msvc-dev-cmd@v1
110-
- name: Install Dependencies
111-
run: |
112-
choco install wget
113-
wget -O hdf5.zip https://support.hdfgroup.org/ftp/HDF5/releases/hdf5-1.12/hdf5-1.12.1/bin/windows/hdf5-1.12.1-Std-win10_64-vs14.zip
114-
tar -xf hdf5.zip
115-
cd hdf
116-
msiexec /i HDF5-1.12.1-win64.msi /quiet /qn /norestart /log log.log INSTALL_ROOT="$Env:RUNNER_TEMP\HDF5_ROOT" | Out-Null
117-
gc log.log
118107
- name: Configure Library
119108
run: |
120109
cmake -Bbuild -DFDPAPI_BUILD_TESTS=ON
121-
env:
122-
HDF5_ROOT: ${{ runner.temp }}\HDF5_ROOT
123110
- name: Compile FDP-Cpp-API
124111
run: cmake --build build --config=Release
125-
env:
126-
HDF5_ROOT: ${{ runner.temp }}\HDF5_ROOT

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,5 @@ build/
44
.bash_profile
55
test/data_store/
66
data_store/
7-
.fair
7+
.fair
8+
venv/

CMakeLists.txt

Lines changed: 18 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,12 @@ ELSE()
1616
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Release")
1717
ENDIF()
1818

19+
IF( FDPAPI_CODE_COVERAGE )
20+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O0 --coverage")
21+
message("CXX Flags: ${CMAKE_CXX_FLAGS}")
22+
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O0")
23+
ENDIF()
24+
1925
# Define Project
2026
PROJECT( fdpapi
2127
VERSION 0.1.0
@@ -26,20 +32,6 @@ PROJECT( fdpapi
2632

2733
set( FDPAPI fdpapi )
2834

29-
# Use HDF5 Static Libraries on Windows
30-
if ( WIN32 )
31-
SET (HDF5_USE_STATIC_LIBRARIES TRUE)
32-
ENDIF()
33-
34-
# Find HDF5 Package
35-
find_package(HDF5 COMPONENTS C CXX)
36-
37-
# If the HDF5 Package is not found stop
38-
if (NOT HDF5_FOUND)
39-
message( FATAL_ERROR "HDF5 Library Not Found,
40-
Please install it and ensure the Environment Variable HDF5_ROOT is set")
41-
ENDIF()
42-
4335
# Set Output Directories to avoid issues on multi release compilers
4436
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
4537
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
@@ -90,49 +82,16 @@ ENDIF()
9082

9183
# Compile Code Coverage if Specified with Tests
9284
IF( FDPAPI_CODE_COVERAGE AND FDPAPI_BUILD_TESTS )
93-
MESSAGE( STATUS "[Coverage]")
94-
SET( COVERAGE_COMPILER_FLAGS "--coverage -fprofile-arcs -ftest-coverage" )
95-
SET( CMAKE_CXX_FLAGS "-std=gnu++17 -O0 -Wall -Wextra -Werror ${COVERAGE_COMPILER_FLAGS} ${CMAKE_CXX_FLAGS}" )
96-
SET( CMAKE_C_FLAGS "-O0 -Wall -Wextra ${COVERAGE_COMPILER_FLAGS} ${CMAKE_C_FLAGS}" )
97-
MESSAGE( "\t CMAKE_CXX_FLAGS: ${CMAKE_CXX_FLAGS}" )
98-
MESSAGE( "\t CMAKE_C_FLAGS: ${CMAKE_C_FLAGS}" )
99-
100-
101-
find_program( LCOV_PATH NAMES lcov lcov.bat lcov.exe lcov.perl)
102-
find_program( GCOV_PATH gcov )
103-
104-
set(LCOV_EXCLUDES "build/*" "/usr*")
105-
106-
add_custom_target(coverage
107-
108-
# Cleanup lcov
109-
COMMAND ${LCOV_PATH} --gcov-tool ${GCOV_PATH} -directory . -b ${PROJECT_SOURCE_DIR} --zerocounters
110-
111-
# Create baseline to make sure untouched files show up in the report
112-
COMMAND ${LCOV_PATH} --gcov-tool ${GCOV_PATH} -c -i -d . -b ${PROJECT_SOURCE_DIR} -o ${FDPAPI}.base
113-
114-
# Run executables
115-
COMMAND ${CMAKE_BINARY_DIR}/test/${FDPAPI}-tests ${COV_TEST_FLAGS}
116-
117-
# Capturing lcov counters and generating report
118-
COMMAND ${LCOV_PATH} --gcov-tool ${GCOV_PATH} --directory . -b ${PROJECT_SOURCE_DIR} --capture --output-file ${FDPAPI}.capture
119-
120-
# add baseline counters
121-
COMMAND ${LCOV_PATH} --gcov-tool ${GCOV_PATH} -a ${FDPAPI}.base -a ${FDPAPI}.capture --output-file ${FDPAPI}.total
122-
123-
# filter collected data to final coverage report and merge outputs
124-
COMMAND ${LCOV_PATH} --gcov-tool ${GCOV_PATH} --remove ${FDPAPI}.total ${LCOV_EXCLUDES} --output-file ${FDPAPI}.info
125-
126-
# Set output files as GENERATED (will be removed on 'make clean')
127-
BYPRODUCTS
128-
${FDPAPI}.base
129-
${FDPAPI}.capture
130-
${FDPAPI}.total
131-
${FDPAPI}.info
132-
${FDPAPI} # report directory
133-
134-
WORKING_DIRECTORY ${PROJECT_BINARY_DIR}
135-
VERBATIM # Protect arguments to commands
136-
COMMENT "Resetting code coverage counters to zero.\nProcessing code coverage counters and generating report."
137-
)
85+
if(CMAKE_COMPILER_IS_GNUCXX)
86+
LIST(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake_modules")
87+
include(CodeCoverage)
88+
APPEND_COVERAGE_COMPILER_FLAGS()
89+
90+
#set(COVERAGE_EXCLUDES 'build/*' 'usr/*')
91+
#set(Coverage_BASE_DIRECTORY ${CMAKE_SOURCE_DIR})
92+
setup_target_for_coverage_gcovr_sonar(NAME coverage
93+
EXECUTABLE bin/${FDPAPI}-tests
94+
DEPENDENCIES ${FDPAPI}-tests
95+
BASE_DIRECTORY ${CMAKE_SOURCE_DIR})
96+
endif()
13897
ENDIF()

0 commit comments

Comments
 (0)