1
0
mirror of https://github.com/CLIUtils/CLI11.git synced 2025-04-29 12:13:52 +00:00

Adding windows test

This commit is contained in:
Henry Fredrick Schreiner 2018-07-06 08:01:21 +02:00 committed by Henry Schreiner
parent 8961df0e8b
commit f6e1b8d7aa
3 changed files with 18 additions and 1 deletions

View File

@ -33,6 +33,10 @@ set(CLI11_TESTS
DeprecatedTest DeprecatedTest
) )
if(WIN32)
list(APPEND CLI11_TESTS WindowsTest)
endif()
set(CLI11_MULTIONLY_TESTS set(CLI11_MULTIONLY_TESTS
TimerTest TimerTest
) )

13
tests/WindowsTest.cpp Normal file
View File

@ -0,0 +1,13 @@
#include "app_helper.hpp"
#include <Windows.h>
// 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"));
}

View File

@ -4,7 +4,7 @@
int do_nothing(); int do_nothing();
// Verifies there are no ungarded inlines // Verifies there are no unguarded inlines
TEST(Link, DoNothing) { TEST(Link, DoNothing) {
int a = do_nothing(); int a = do_nothing();
EXPECT_EQ(7, a); EXPECT_EQ(7, a);