diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index d2c44e00..b2dd03f8 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -166,6 +166,9 @@ jobs: - name: Build run: meson compile -C build-meson + - name: Test + run: meson test -C build-meson + install: name: install tests runs-on: ubuntu-latest diff --git a/meson.build b/meson.build index c0de945e..1b6d98e9 100644 --- a/meson.build +++ b/meson.build @@ -1,5 +1,7 @@ project('CLI11', ['cpp'], version : run_command(find_program('scripts/ExtractVersion.py'), check: true).stdout().strip(), + license : 'BSD-3-clause', + meson_version : '>= 0.60', default_options : ['cpp_std=c++11', 'warning_level=3'] ) @@ -12,6 +14,8 @@ CLI11_dep = declare_dependency( version : meson.project_version(), ) +meson.override_dependency('CLI11', CLI11_dep) + if get_option('tests') warnings = ['-Wshadow', '-Wsign-conversion', '-Wswitch-enum'] if cxx.get_id() == 'gcc' and cxx.version().version_compare('>=4.9') diff --git a/tests/meson.build b/tests/meson.build index 383d03a4..7fd05a4b 100644 --- a/tests/meson.build +++ b/tests/meson.build @@ -69,14 +69,16 @@ dependent_applications = [ 'ensure_utf8_twice', ] dependent_applications_definitions = [] -#dependent_applications_targets = [] +dependent_applications_targets = [] foreach app: dependent_applications - app_target = executable(app, 'applications'/app + '.cpp', - build_by_default: false + app_target = executable( + app, 'applications'/app + '.cpp', + dependencies: CLI11_dep, ) - #dependent_applications_targets += dependency(app_target) - dependent_applications_definitions += '-DCLI11_@0@_EXE="@1@"'.format(app.to_upper(), app_target) + dependent_applications_targets += app_target + dependent_applications_definitions += '-DCLI11_@0@_EXE="@1@/@2@"'.format( + app.to_upper(), meson.current_build_dir(), app_target) endforeach if host_machine.system() == 'windows' @@ -96,5 +98,5 @@ foreach n: testnames dependencies: [testdep] + kwargs.get('dependencies', []), link_with: kwargs.get('link_with', []) ) - test(name, t) + test(name, t, depends: dependent_applications_targets) endforeach