diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 64698fe2..bce96200 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -33,6 +33,10 @@ set(CLI11_TESTS DeprecatedTest ) +if(WIN32) + list(APPEND CLI11_TESTS WindowsTest) +endif() + set(CLI11_MULTIONLY_TESTS TimerTest ) diff --git a/tests/WindowsTest.cpp b/tests/WindowsTest.cpp new file mode 100644 index 00000000..bae81266 --- /dev/null +++ b/tests/WindowsTest.cpp @@ -0,0 +1,13 @@ +#include "app_helper.hpp" +#include + +// This test verifies that CLI11 still works if +// Windows.h is included. #145 + +TEST_F(TApp, WindowsTestSimple) { + app.add_flag("-c,--count"); + args = {"-c"}; + run(); + EXPECT_EQ((size_t)1, app.count("-c")); + EXPECT_EQ((size_t)1, app.count("--count")); +} diff --git a/tests/link_test_2.cpp b/tests/link_test_2.cpp index a198b6ed..85c5a74f 100644 --- a/tests/link_test_2.cpp +++ b/tests/link_test_2.cpp @@ -4,7 +4,7 @@ int do_nothing(); -// Verifies there are no ungarded inlines +// Verifies there are no unguarded inlines TEST(Link, DoNothing) { int a = do_nothing(); EXPECT_EQ(7, a);