Files
CLI11/tests/BUILD.bazel
Zephyr Lykos f0eddc8dc5 Refactor meson build system (#1280)
- Bump meson version to 1.3
- Bump default cpp_std (required by Catch2 3.x, still possible for c++11
fallback)
- Move option `single-file-header` and `precompiled` to `mode`
- Make pkgconfig optional
- Refactor tests, fix a bizzare situation where filename contains quote
  or escape characters
2026-01-16 17:39:24 -08:00

82 lines
1.7 KiB
Python

cc_binary(
name = "ensure_utf8",
srcs = ["applications/ensure_utf8.cpp"],
deps = ["//:cli11"],
)
cc_binary(
name = "ensure_utf8_twice",
srcs = ["applications/ensure_utf8_twice.cpp"],
deps = ["//:cli11"],
)
cc_library(
name = "catch_main",
srcs = ["main.cpp"],
hdrs = ["catch.hpp"],
defines = ["CLI11_CATCH3"],
deps = ["@catch2//:catch2_main"],
)
cc_test(
name = "AppTest",
srcs = [
"AppTest.cpp",
"app_helper.hpp",
],
data = [
"ensure_utf8",
"ensure_utf8_twice",
],
local_defines = [
'CLI11_ENSURE_UTF8_EXE=\\"$(rootpath ensure_utf8)\\"',
'CLI11_ENSURE_UTF8_TWICE_EXE=\\"$(rootpath ensure_utf8_twice)\\"',
],
deps = [
"catch_main",
"//:cli11",
"@catch2",
],
linkopts = select({
"@rules_cc//cc/compiler:msvc-cl": [],
"@rules_cc//cc/compiler:clang-cl": [],
"//conditions:default": ["-pthread"],
}),
)
[
cc_test(
name = test,
srcs = [
test + ".cpp",
"app_helper.hpp",
],
deps = [
"catch_main",
"//:cli11",
"@catch2",
],
)
for test in [
"HelpersTest",
"ConfigFileTest",
"OptionTypeTest",
"SimpleTest",
"SetTest",
"NumericTypeTest",
"TransformTest",
"CreationTest",
"SubcommandTest",
"HelpTest",
"FormatterTest",
"NewParseTest",
"OptionalTest",
"DeprecatedTest",
"StringParseTest",
"ComplexTypeTest",
"TrueFalseTest",
"OptionGroupTest",
"EncodingTest",
]
]