Skip to content

Commit

Permalink
Add ctest -T memcheck to developer workflow so valgrind is run on all…
Browse files Browse the repository at this point in the history
… tests and must pass (#480)

* removed IF (ASSOCIATED(CBUF)) because CBUF is undefined

* fix associated() check on undefind pointer in ixgb2()

* fixing some memory problems

* fixing some memory problems

* whitespace cleanup

* turn off printing in test that causes memory problems

* initialized local variable to solve memory issue

* fixed memory leak in test_files

* initialized array in gdt2gds() to solve memory problems

* fixed uninitialized memory in test_g2_encode

* fixed memory problem in test code

* add memory checking to developer workflow

* add memory checking to developer workflow

* trying a matrix

* trying a matrix

* trying a matrix

* better job names

* better job names

* better job names

* better job names

* better job names

* better job names

* better job names

* new cache key for data cache

---------

Co-authored-by: Ed <edwardjameshartnett@gmail.com>
  • Loading branch information
edwardhartnett and edhartnett authored Jul 10, 2023
1 parent c8f0e30 commit 7466a82
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/Linux_versions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ jobs:
uses: actions/cache@v3
with:
path: ~/data
key: data-1
key: data-2

- name: build
run: |
Expand Down
21 changes: 16 additions & 5 deletions .github/workflows/developer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,15 @@ jobs:

strategy:
fail-fast: true
matrix:
config: ["asan/code coverage", "memcheck"]

steps:

- name: install-dependencies
run: |
sudo apt-get update
sudo apt-get install libpng-dev zlib1g-dev libjpeg-dev doxygen gcovr
sudo apt-get install libpng-dev zlib1g-dev libjpeg-dev doxygen gcovr valgrind
- name: checkout-bacio
uses: actions/checkout@v3
Expand Down Expand Up @@ -96,7 +98,7 @@ jobs:
uses: actions/cache@v3
with:
path: ~/data
key: data-1
key: data-2

- name: build
run: |
Expand All @@ -105,14 +107,22 @@ jobs:
mkdir build
doxygen --version
cd build
cmake .. -DENABLE_DOCS=On -DJasper_ROOT=~/Jasper -DCMAKE_PREFIX_PATH="~/bacio;~/w3emc" -DCMAKE_Fortran_FLAGS="-g -fprofile-abs-path -fprofile-arcs -ftest-coverage -O0 -Wall -fno-omit-frame-pointer -fsanitize=address" -DCMAKE_C_FLAGS="-g -fprofile-abs-path -fprofile-arcs -ftest-coverage -O0 -Wall -fno-omit-frame-pointer -fsanitize=address" -DFTP_TEST_FILES=ON -DTEST_FILE_DIR=/home/runner/data -DCMAKE_BUILD_TYPE=Debug
if [ ${{ matrix.config }} == "asan/code coverage" ]; then
cmake .. -DENABLE_DOCS=On -DJasper_ROOT=~/Jasper -DCMAKE_PREFIX_PATH="~/bacio;~/w3emc" -DCMAKE_Fortran_FLAGS="-g -fprofile-abs-path -fprofile-arcs -ftest-coverage -O0 -Wall -fno-omit-frame-pointer -fsanitize=address" -DCMAKE_C_FLAGS="-g -fprofile-abs-path -fprofile-arcs -ftest-coverage -O0 -Wall -fno-omit-frame-pointer -fsanitize=address" -DFTP_TEST_FILES=ON -DTEST_FILE_DIR=/home/runner/data -DCMAKE_BUILD_TYPE=Debug
else
cmake .. -DENABLE_DOCS=On -DJasper_ROOT=~/Jasper -DCMAKE_PREFIX_PATH="~/bacio;~/w3emc" -DCMAKE_Fortran_FLAGS="-g -O0" -DCMAKE_C_FLAGS="-g -O0" -DFTP_TEST_FILES=ON -DTEST_FILE_DIR=/home/runner/data -DCMAKE_BUILD_TYPE=Debug
fi
make -j2 VERBOSE=1
- name: test
run: |
cd $GITHUB_WORKSPACE/g2/build
ctest --verbose --output-on-failure --rerun-failed
gcovr --root .. -v --html-details --exclude ../tests --exclude CMakeFiles --print-summary -o test-coverage.html &> /dev/null
if [ ${{ matrix.config }} == "asan/code coverage" ]; then
ctest --verbose --output-on-failure --rerun-failed
gcovr --root .. -v --html-details --exclude ../tests --exclude CMakeFiles --print-summary -o test-coverage.html &> /dev/null
else
ctest -T memcheck
fi
- name: cache-data
if: steps.cache-data.outputs.cache-hit != 'true'
Expand All @@ -121,6 +131,7 @@ jobs:
cp $GITHUB_WORKSPACE/g2/build/tests/data/* ~/data
- name: upload-test-coverage
if: ${{ matrix.config }} == "asan/code coverage"
uses: actions/upload-artifact@v3
with:
name: g2-test-coverage
Expand Down

0 comments on commit 7466a82

Please sign in to comment.