Skip to content

Commit 774c13e

Browse files
committed
Run sanitizer with CTest
1 parent fa6d8cc commit 774c13e

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

.github/workflows/continuous-testing.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,8 @@ jobs:
5454
with: { environment-file: dev/conda.yaml }
5555
- name: "Configure, build, and test ecole-lib with sanitizer."
5656
shell: bash -l {0}
57-
run: bash dev/run.sh --fix-pythonpath configure -D SANITIZE_ADDRESS=ON -- test-lib
57+
# Using Ctest runner to avoid out of memory
58+
run: bash dev/run.sh --fix-pythonpath configure -D SANITIZE_ADDRESS=ON -- ctest-lib
5859

5960
check-code:
6061
runs-on: ubuntu-20.04

dev/run.sh

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,22 @@ function test_lib {
184184
}
185185

186186

187+
# CTest runner runs test individually, reducing mem consumption
188+
function ctest_lib {
189+
if files_have_changed 'CMakeLists.txt' 'libecole'; then
190+
if_rebuild_then build_lib_test
191+
local extra_args=("$@")
192+
if [ "${fail_fast}" = "true" ]; then
193+
extra_args+=("--stop-on-failure ")
194+
fi
195+
# Possible option --parallel
196+
cmake_build test -- ARGS="${extra_args[@]}"
197+
else
198+
log "Skipping ${FUNCNAME[0]} as unchanged since ${rev}."
199+
fi
200+
}
201+
202+
187203
function test_py {
188204
local -r relevant_files=('CMakeLists.txt' 'libecole/CMakeLists.txt' 'libecole/src' 'libecole/include' 'python')
189205
if files_have_changed "${relevant_files[@]}"; then

0 commit comments

Comments
 (0)