Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

splitting code coverage #507

Closed
wants to merge 7 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 34 additions & 6 deletions .github/workflows/developer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
strategy:
fail-fast: true
matrix:
config: ["asan/code coverage", "memcheck"]
config: ["asan", "code coverage", "memcheck", "docs"]

steps:
- name: install-dependencies
Expand All @@ -49,37 +49,65 @@ jobs:
key: data-2

- name: asan
if: matrix.config == 'asan/code coverage'
if: matrix.config == 'asan'
run: |
set -x
export CC=gcc
cmake -S g2c -B g2c/build -DUSE_AEC=ON -DJasper_ROOT=$GITHUB_WORKSPACE/nceplibs/jasper -DBUILD_G2C=ON -DLOGGING=On -DENABLE_DOCS=On -DPTHREADS=ON -DFTP_TEST_FILES=ON -DFTP_LARGE_TEST_FILES=OFF -DTEST_FILE_DIR=/home/runner/data -DCMAKE_BUILD_TYPE=Debug
cmake -S g2c -B g2c/build -DUSE_AEC=ON -DJasper_ROOT=$GITHUB_WORKSPACE/nceplibs/jasper -DBUILD_G2C=ON -DLOGGING=On -DPTHREADS=ON -DFTP_TEST_FILES=ON -DFTP_LARGE_TEST_FILES=OFF -DTEST_FILE_DIR=/home/runner/data -DCMAKE_BUILD_TYPE=Debug-DCMAKE_C_FLAGS="-Werror -g -O0 -fsanitize=address -fno-omit-frame-pointer"
cmake --build g2c/build --parallel 2 --verbose
ctest --test-dir g2c/build --verbose --output-on-failure --rerun-failed
gcovr --root g2c -v --html-details --exclude g2c/tests --exclude g2c/build/CMakeFiles --print-summary -o test-coverage.html

- name: code_coverage
if: matrix.config == 'code coverage'
run: |
set -x
export CC=gcc
cmake -S g2c -B g2c/build -DUSE_AEC=ON -DJasper_ROOT=$GITHUB_WORKSPACE/nceplibs/jasper -DBUILD_G2C=ON -DLOGGING=On -DPTHREADS=ON -DFTP_TEST_FILES=ON -DFTP_LARGE_TEST_FILES=OFF -DTEST_FILE_DIR=/home/runner/data -DCMAKE_BUILD_TYPE=Debug-DCMAKE_C_FLAGS="-g -fprofile-arcs -ftest-coverage -fprofile-abs-path -O0"
pwd
cd g2c/build
make VERBOSE=1
ctest --verbose --output-on-failure --rerun-failed
gcovr --root .. -v --html-details --exclude tests --exclude CMakeFiles --print-summary -o test-coverage.html
pwd
ls -l
ls -l src

- name: memcheck
if: matrix.config == 'memcheck'
run: |
set -x
export LD_LIBRARY_PATH="/home/runner/jasper/lib:$LD_LIBRARY_PATH"
cmake -S g2c -B g2c/build -DUSE_AEC=ON -DJasper_ROOT=$GITHUB_WORKSPACE/nceplibs/jasper -DBUILD_G2C=ON -DLOGGING=On -DENABLE_DOCS=On -DPTHREADS=ON -DFTP_TEST_FILES=ON -DTEST_FILE_DIR=/home/runner/data -DCMAKE_BUILD_TYPE=Debug
cmake -S g2c -B g2c/build -DUSE_AEC=ON -DJasper_ROOT=$GITHUB_WORKSPACE/nceplibs/jasper -DBUILD_G2C=ON -DLOGGING=On -DPTHREADS=ON -DFTP_TEST_FILES=ON -DTEST_FILE_DIR=/home/runner/data -DCMAKE_BUILD_TYPE=Debug -DCMAKE_C_FLAGS="-g"
cmake --build g2c/build --parallel 2 --verbose
ctest --test-dir g2c/build
ls -l g2c/build

- name: docs
if: matrix.config == 'docs'
run: |
set -x
export LD_LIBRARY_PATH="/home/runner/jasper/lib:$LD_LIBRARY_PATH"
cmake -S g2c -B g2c/build -DUSE_AEC=ON -DJasper_ROOT=$GITHUB_WORKSPACE/nceplibs/jasper -DBUILD_G2C=ON -DENABLE_DOCS=On -DCMAKE_BUILD_TYPE=Debug -DCMAKE_C_FLAGS="-g"
cmake --build g2c/build --parallel 2 --verbose
ls -l g2c/build/docs/html

- name: cache-data
if: steps.cache-data.outputs.cache-hit != 'true'
run: |
mkdir ~/data
cp $GITHUB_WORKSPACE/g2c/build/tests/data/* ~/data

- name: upload-test-coverage
if: matrix.config == 'asan/code coverage'
if: matrix.config == 'code coverage'
uses: actions/upload-artifact@v4
with:
name: g2c-test-coverage
path: |
*.html
*.css
- uses: actions/upload-artifact@v4
if: matrix.config == 'docs'
with:
name: docs
path: |
g2c/build/docs/html
1 change: 0 additions & 1 deletion tests/tst_degrib2_ftp_all.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ main()
int f;
int t;
int ret;
g2c_set_log_level(15);

/* for (f = 0; f < NUM_FILES; f++) */
for (f = 0; f < 1; f++)
Expand Down
Loading