Skip to content

Commit

Permalink
meson.build: switch the valgrind test logic around
Browse files Browse the repository at this point in the history
The current logic requires that --suite=valgrind is passed to a meson
test run with --setup=valgrind. Since we don't want to valgrind the
python tests (lest we have to valgrind python itself which is slow and
error-prone) let's switch the logic around and use the slightly newer
--exclude-suit to skip any pytest runs.
  • Loading branch information
whot committed Aug 15, 2024
1 parent 62b2e72 commit 292a521
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ jobs:
- name: valgrind - meson test
uses: ./.github/actions/meson
with:
meson_test_args: --setup=valgrind --suite=valgrind
meson_test_args: --setup=valgrind
env:
CC: ${{matrix.compiler}}
# Capture all the meson logs, even if we failed
Expand Down
13 changes: 7 additions & 6 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ project('libwacom', 'c',
version: '2.12.2',
license: 'HPND',
default_options: [ 'c_std=gnu99', 'warning_level=2' ],
meson_version: '>= 0.56.0')
meson_version: '>= 0.57.0')

dir_bin = get_option('prefix') / get_option('bindir')
dir_data = get_option('prefix') / get_option('datadir') / 'libwacom'
Expand Down Expand Up @@ -245,36 +245,37 @@ if get_option('tests').enabled()
include_directories: [includes_include, includes_src],
c_args: tests_cflags,
install: false)
test('test-load', test_load, suite: ['all', 'valgrind'])
test('test-load', test_load, suite: ['all'])

test_dbverify = executable('test-dbverify',
'test/test-dbverify.c',
dependencies: [dep_libwacom, dep_glib],
include_directories: [includes_src],
c_args: tests_cflags,
install: false)
test('test-dbverify', test_dbverify, suite: ['all', 'valgrind'])
test('test-dbverify', test_dbverify, suite: ['all'])

test_tablet_validity = executable('test-tablet-validity',
'test/test-tablet-validity.c',
dependencies: [dep_libwacom, dep_glib],
include_directories: [includes_src],
c_args: tests_cflags,
install: false)
test('test-tablet-validity', test_tablet_validity, suite: ['all', 'valgrind'])
test('test-tablet-validity', test_tablet_validity, suite: ['all'])

test_stylus_validity= executable('test-stylus-validity',
'test/test-stylus-validity.c',
dependencies: [dep_libwacom, dep_glib],
include_directories: [includes_src],
c_args: tests_cflags,
install: false)
test('test-stylus-validity', test_stylus_validity, suite: ['all', 'valgrind'])
test('test-stylus-validity', test_stylus_validity, suite: ['all'])

valgrind = find_program('valgrind', required : false)
if valgrind.found()
valgrind_suppressions_file = dir_test / 'valgrind.suppressions'
add_test_setup('valgrind',
exclude_suites: ['not-in-valgrind'],
exe_wrapper: [valgrind,
'--leak-check=full',
'--gen-suppressions=all',
Expand Down Expand Up @@ -310,7 +311,7 @@ if get_option('tests').enabled()
],
env: env,
timeout: 60,
suite: ['all'])
suite: ['all', 'not-in-valgrind'])
endforeach
endif
endif
Expand Down
2 changes: 1 addition & 1 deletion run-full-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ ninja -C $builddir test

echo "####################################### running valgrind"
pushd $builddir > /dev/null
meson test --setup=valgrind --suite=valgrind
meson test --setup=valgrind
popd > /dev/null

echo "####################################### running ubsan"
Expand Down

0 comments on commit 292a521

Please sign in to comment.