Commit f6e1b8d7aa234dd32fb8c835b27b09ff09e3d520

Authored by Henry Fredrick Schreiner
Committed by Henry Schreiner
1 parent 8961df0e

Adding windows test

tests/CMakeLists.txt
@@ -33,6 +33,10 @@ set(CLI11_TESTS @@ -33,6 +33,10 @@ set(CLI11_TESTS
33 DeprecatedTest 33 DeprecatedTest
34 ) 34 )
35 35
  36 +if(WIN32)
  37 + list(APPEND CLI11_TESTS WindowsTest)
  38 +endif()
  39 +
36 set(CLI11_MULTIONLY_TESTS 40 set(CLI11_MULTIONLY_TESTS
37 TimerTest 41 TimerTest
38 ) 42 )
tests/WindowsTest.cpp 0 → 100644
  1 +#include "app_helper.hpp"
  2 +#include <Windows.h>
  3 +
  4 +// This test verifies that CLI11 still works if
  5 +// Windows.h is included. #145
  6 +
  7 +TEST_F(TApp, WindowsTestSimple) {
  8 + app.add_flag("-c,--count");
  9 + args = {"-c"};
  10 + run();
  11 + EXPECT_EQ((size_t)1, app.count("-c"));
  12 + EXPECT_EQ((size_t)1, app.count("--count"));
  13 +}
tests/link_test_2.cpp
@@ -4,7 +4,7 @@ @@ -4,7 +4,7 @@
4 4
5 int do_nothing(); 5 int do_nothing();
6 6
7 -// Verifies there are no ungarded inlines 7 +// Verifies there are no unguarded inlines
8 TEST(Link, DoNothing) { 8 TEST(Link, DoNothing) {
9 int a = do_nothing(); 9 int a = do_nothing();
10 EXPECT_EQ(7, a); 10 EXPECT_EQ(7, a);