Skip to content

Commit c17a711

Browse files
committed
fix/workaround valgrind
1 parent 19f554e commit c17a711

File tree

3 files changed

+6
-9
lines changed

3 files changed

+6
-9
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ jobs:
7373
7474
- uses: actions/checkout@v4
7575

76-
- run: ctest -S memcheck.cmake -V -E Fortran_nano_sleep
76+
- run: ctest -S memcheck.cmake -V -E "Fortran_nano_sleep|string_array"
7777

7878

7979
linux-clang:

memcheck.cmake

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,14 @@ cmake_minimum_required(VERSION 3.19)
1010

1111
list(APPEND opts -DCMAKE_BUILD_TYPE=Debug)
1212

13-
set(CTEST_TEST_TIMEOUT 60)
14-
# takes effect only if test property TIMEOUT is not set
15-
1613
if(NOT DEFINED CTEST_MEMORYCHECK_TYPE)
1714
set(CTEST_MEMORYCHECK_TYPE "Valgrind")
1815
endif()
1916

2017
if(CTEST_MEMORYCHECK_TYPE STREQUAL "Valgrind")
2118
# https://www.cprogramming.com/debugging/valgrind.html
2219
find_program(CTEST_MEMORYCHECK_COMMAND NAMES valgrind HINTS ${MEMCHECK_ROOT} REQUIRED)
23-
set(CTEST_MEMORYCHECK_COMMAND_OPTIONS)
20+
set(CTEST_MEMORYCHECK_COMMAND_OPTIONS --leak-check=full)
2421
set(supp ${CMAKE_CURRENT_LIST_DIR}/valgrind.supp)
2522
if(EXISTS ${supp})
2623
list(APPEND CTEST_MEMORYCHECK_COMMAND_OPTIONS --suppressions=${supp})
@@ -77,10 +74,7 @@ if(NOT (ret EQUAL 0 AND err EQUAL 0))
7774
message(FATAL_ERROR "CMake configure failed: ${ret} ${err}")
7875
endif()
7976

80-
cmake_host_system_information(RESULT Ncpu QUERY NUMBER_OF_PHYSICAL_CORES)
81-
8277
ctest_build(
83-
PARALLEL_LEVEL ${Ncpu}
8478
RETURN_VALUE ret
8579
CAPTURE_CMAKE_ERROR err
8680
)
@@ -96,7 +90,6 @@ EXCLUDE_LABEL ${exclude_label}
9690
RETURN_VALUE ret
9791
CAPTURE_CMAKE_ERROR err
9892
DEFECT_COUNT count
99-
PARALLEL_LEVEL ${Ncpu}
10093
)
10194

10295
if(NOT (ret EQUAL 0 AND err EQUAL 0))

test/iso_fortran_binding/string_view.f90

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,14 @@ subroutine echo_c( str ) bind(C)
1212
end subroutine
1313
end interface
1414

15+
valgrind : block
16+
1517
character(kind=c_char, len=:), allocatable :: s
1618

1719
s = c_char_"Hello World!"
1820

1921
call echo_c( s )
2022

23+
end block valgrind
24+
2125
end program

0 commit comments

Comments
 (0)