Skip to content

Commit

Permalink
tests: correctly handle the skippability of wxwidgets framework
Browse files Browse the repository at this point in the history
Back when we originally added this "if found, do fundamental logic" code
in commit 24aa7f3, conditionally
performing the test logic was the state of the art. Later that year, we
implemented the MESON_SKIP_TEST protocol for actually marking skipped
tests as skipped, rather than silently doing nothing. We should use this
so that people know when the test was skipped. :)
  • Loading branch information
eli-schwartz committed Oct 28, 2024
1 parent 0687b9b commit f87f002
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions test cases/frameworks/9 wxwidgets/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,18 @@ project('wxwidgets test', 'cpp', default_options : ['cpp_std=c++11'])
wxd = dependency('wxwidgets', version : '>=5', required : false)
wxd = dependency('wxwidgets', version : '>=3.0.0', required : false)

if wxd.found()
wp = executable('wxprog', 'wxprog.cpp', dependencies : wxd)
if not wxd.found()
error('MESON_SKIP_TEST: wxwidgets dependency not found')
endif

test('wxtest', wp)
wp = executable('wxprog', 'wxprog.cpp', dependencies : wxd)

# WxWidgets framework is available, we can use required here
wx_stc = dependency('wxwidgets', version : '>=3.0.0', modules : ['std', 'stc'])
stc_exe = executable('wxstc', 'wxstc.cpp', dependencies : wx_stc)
test('wxstctest', stc_exe)
test('wxtest', wp)

# Check we can apply a version constraint
dependency('wxwidgets', version: '>=@0@'.format(wxd.version()))
# WxWidgets framework is available, we can use required here
wx_stc = dependency('wxwidgets', version : '>=3.0.0', modules : ['std', 'stc'])
stc_exe = executable('wxstc', 'wxstc.cpp', dependencies : wx_stc)
test('wxstctest', stc_exe)

endif
# Check we can apply a version constraint
dependency('wxwidgets', version: '>=@0@'.format(wxd.version()))

0 comments on commit f87f002

Please sign in to comment.