Skip to content

Commit

Permalink
test: move the asan check into meson.build
Browse files Browse the repository at this point in the history
meson always sets ASAN_OPTIONS/UBSAN_OPTIONS even where they're not
used which lead to us skipping the various SVG tests during meson test.

Instead move this to meson.build and just run pytest if sanitize is off.
  • Loading branch information
whot committed May 13, 2024
1 parent d79d292 commit f3e2e7f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 13 deletions.
22 changes: 12 additions & 10 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -285,16 +285,18 @@ if get_option('tests').enabled()
message('valgrind not found, disabling valgrind test suite')
endif

env = environment()
env.set('MESON_SOURCE_ROOT', meson.current_source_dir())
env.set('LD_LIBRARY_PATH', fs.parent(lib_libwacom.full_path()))
pymod.find_installation(modules: ['libevdev', 'pyudev', 'pytest'])
pytest = find_program('pytest-3', 'pytest')
test('pytest',
pytest,
args: ['--verbose', '--log-level=DEBUG', meson.current_source_dir()],
env: env,
suite: ['all'])
if get_option('b_sanitize') == 'none'
env = environment()
env.set('MESON_SOURCE_ROOT', meson.current_source_dir())
env.set('LD_LIBRARY_PATH', fs.parent(lib_libwacom.full_path()))
pymod.find_installation(modules: ['libevdev', 'pyudev', 'pytest'])
pytest = find_program('pytest-3', 'pytest')
test('pytest',
pytest,
args: ['--verbose', '--log-level=DEBUG', '-k', 'test_svg', meson.current_source_dir()],
env: env,
suite: ['all'])
endif
endif

# This is a non-optional test
Expand Down
3 changes: 0 additions & 3 deletions test/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@


def load_test_db() -> WacomDatabase:
if any(os.environ.get(v) for v in ["ASAN_OPTIONS", "UBSAN_OPTIONS"]):
pytest.skip("ASAN/UBSAN not supported in this module")

try:
dbpath = os.environ.get("MESON_SOURCE_ROOT")
if dbpath is None and (Path.cwd() / "meson.build").exists():
Expand Down

0 comments on commit f3e2e7f

Please sign in to comment.