-
Notifications
You must be signed in to change notification settings - Fork 51
49 lines (45 loc) · 1.64 KB
/
memcheck_tests.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
name: MemCheck Tests
on: [push, pull_request]
jobs:
memcheck_tests:
runs-on: ubuntu-latest
steps:
- name: Checkout MDAL
uses: actions/checkout@v2
- name: install deps
run: |
sudo add-apt-repository ppa:ubuntugis/ppa -y
sudo apt-get install -y --allow-unauthenticated libgdal-dev
sudo apt-get install -y libhdf5-dev libnetcdf-dev
sudo apt-get install -y libxml2-dev
sudo apt-get install libc6-dbg gdb valgrind
valgrind --version
- name: build MDAL with valgrind
run: |
mkdir -p ../build_memcheck_lnx
cd ../build_memcheck_lnx
cmake \
-DCMAKE_BUILD_TYPE=Debug \
-DENABLE_TESTS=ON \
-DMEMORYCHECK_COMMAND_OPTIONS="--leak-check=yes --show-leak-kinds=definite --gen-suppressions=all --track-origins=yes --num-callers=20 --leak-resolution=high --show-reachable=no" \
-DMEMORYCHECK_SUPPRESSIONS_FILE=../scripts/valgrind.supp \
-DWITH_POSTGRESQL=TRUE \
../MDAL
make -j`nproc`
- name: Run tests
env:
CTEST_TARGET_SYSTEM: Linux-gcc
GLIBCPP_FORCE_NEW: 1
GLIBCXX_FORCE_NEW: 1
run: |
cd ../build_memcheck_lnx
ctest -T memcheck 2>&1 | tee memcheck.log
- name: Check memcheck for errors
run: |
cd ../build_memcheck_lnx
if grep -q "Defects:" "memcheck.log"; then
echo "Error: Show memcheck results"
ls -la Testing/Temporary/MemoryChecker.*.log
cat Testing/Temporary/MemoryChecker.*.log
exit 1
fi