mirror of
https://github.com/CLIUtils/CLI11.git
synced 2025-05-01 21:23:52 +00:00
* Add unicode support tests * Add unicode parse tests * Implement #14 * Slim down Windows.h * Fix documentation comments * Fix clang-tidy and cpplint * Update README * Fix clang-tidy * Fix to_path not being available on linux * Add roundtrip encoding tests * style: pre-commit.ci fixes * Fix pre-commit.ci * Fix codacy * Exclude parse_unicode which should not contain a newline from pre-commit * Remove a test which breaks CI * Fix build in CI * Replace broken execute_with tests * Fix wide string conversions on all systems * Fix system args on apple * style: pre-commit.ci fixes * Fix some includes * Fix wrong size calculation and comments * Add guards around codecvt * Fix _Pragma not recognized on MSVC * Fix bad macro check * Fix include * Fix narrow and widen when codecvt is missing * Fix some weird bug in old MSVC * Add dependent applications to meson-build * Fix precompilation * Fix lint * Fix coverage * Update README * style: pre-commit.ci fixes * Fix lint * Fix coverage * Fix optional braces offending clang * Remove copied comments from Windows.h * Suppress flawfinder detects * Fix cmake config tests failing because of a missing lib * chore: update copyright on new files to 2023 Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com> * style: pre-commit.ci fixes Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Henry Schreiner <henryschreineriii@gmail.com>
93 lines
2.2 KiB
Meson
93 lines
2.2 KiB
Meson
catch2 = dependency('catch2')
|
|
|
|
testmain = static_library(
|
|
'catch_main',
|
|
'main.cpp', 'catch.hpp',
|
|
dependencies: catch2,
|
|
)
|
|
testdep = declare_dependency(
|
|
link_with: testmain,
|
|
dependencies: [catch2, CLI11_dep]
|
|
)
|
|
|
|
link_test_lib = library(
|
|
'link_test_1',
|
|
'link_test_1.cpp',
|
|
dependencies: CLI11_dep,
|
|
)
|
|
|
|
if cxx.get_id() == 'msvc'
|
|
nodeprecated = ['/wd4996']
|
|
else
|
|
nodeprecated = ['-Wno-deprecated-declarations']
|
|
endif
|
|
|
|
boost = dependency('boost', required: false)
|
|
if boost.found()
|
|
boost_dep = declare_dependency(
|
|
dependencies: boost,
|
|
compile_args: '-DCLI11_BOOST_OPTIONAL',
|
|
)
|
|
else
|
|
boost_dep = declare_dependency()
|
|
endif
|
|
|
|
testnames = [
|
|
['HelpersTest', {}],
|
|
['ConfigFileTest', {}],
|
|
['OptionTypeTest', {}],
|
|
['SimpleTest', {}],
|
|
['AppTest', {}],
|
|
['SetTest', {}],
|
|
['TransformTest', {}],
|
|
['CreationTest', {}],
|
|
['SubcommandTest', {}],
|
|
['HelpTest', {}],
|
|
['FormatterTest', {}],
|
|
['NewParseTest', {}],
|
|
['OptionalTest', {'dependencies': boost_dep}],
|
|
['DeprecatedTest', {'cpp_args': nodeprecated}],
|
|
['StringParseTest', {}],
|
|
['ComplexTypeTest', {}],
|
|
['TrueFalseTest', {}],
|
|
['OptionGroupTest', {}],
|
|
# multi-only
|
|
['TimerTest', {}],
|
|
# link_test
|
|
['link_test_2', {'link_with': link_test_lib}],
|
|
]
|
|
|
|
dependent_applications = [
|
|
'system_args'
|
|
]
|
|
dependent_applications_definitions = []
|
|
#dependent_applications_targets = []
|
|
foreach app: dependent_applications
|
|
app_target = executable(app, 'applications'/app + '.cpp',
|
|
build_by_default: false
|
|
)
|
|
|
|
#dependent_applications_targets += dependency(app_target)
|
|
dependent_applications_definitions += '-DCLI11_@0@_EXE="@1@"'.format(app.to_upper(), app_target)
|
|
endforeach
|
|
|
|
if host_machine.system() == 'windows'
|
|
testnames += [['WindowsTest', {}]]
|
|
endif
|
|
|
|
if boost.found()
|
|
testnames += [['BoostOptionTypeTest', {'dependencies': boost_dep}]]
|
|
endif
|
|
|
|
foreach n: testnames
|
|
name = n[0]
|
|
kwargs = n[1]
|
|
t = executable(name, name + '.cpp',
|
|
cpp_args: kwargs.get('cpp_args', []) + dependent_applications_definitions,
|
|
build_by_default: false,
|
|
dependencies: [testdep] + kwargs.get('dependencies', []),
|
|
link_with: kwargs.get('link_with', [])
|
|
)
|
|
test(name, t)
|
|
endforeach
|