Skip to content

Commit

Permalink
Add windows to Travis CI matrix
Browse files Browse the repository at this point in the history
Because Windows builds also matters! Also, cleanup too old XCode because
nobody use them.
  • Loading branch information
ikalnytskyi committed Sep 29, 2019
1 parent 96914f1 commit 5724206
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 8 deletions.
21 changes: 13 additions & 8 deletions .travis.yml
@@ -1,10 +1,9 @@
sudo: false
language: cpp

script:
- eval "CXX=${COMPILER}"
- cmake -DTERMCOLOR_TESTS=ON .
- make
- cmake --build .
- ./test_termcolor

jobs:
Expand Down Expand Up @@ -106,18 +105,24 @@ jobs:
packages: clang-9
env: COMPILER="clang++-9"

- os: osx
osx_image: xcode8.3

- os: osx
osx_image: xcode9.4

- os: osx
osx_image: xcode10

- os: osx
osx_image: xcode11

- os: windows
script:
- cmake -DTERMCOLOR_TESTS=ON .
- cmake --build .
- ./Debug/test_termcolor.exe

- os: windows
script:
- cmake -DCMAKE_SH="CMAKE_SH-NOTFOUND" -DTERMCOLOR_TESTS=ON -G "MinGW Makefiles" .
- cmake --build .
- ./test_termcolor

- script:
- mkdir -p /tmp/termcolor && cd "$_"
- cmake $TRAVIS_BUILD_DIR
Expand Down
6 changes: 6 additions & 0 deletions test/test.cpp
Expand Up @@ -9,6 +9,10 @@
//! :license: BSD, see LICENSE for details
//!

#if defined(_WIN32) || defined(_WIN64)
# define NO_ANSI_ESCAPE_SEQUENCES
#endif

// Cygwin's C++ libraries seem to be stricter than other unix platforms.
// Strict standard conformance must be disabled by passing -U__STRICT_ANSI__
// (or equivalent option) to the compiler, or by #undef __STRICT_ANSI__
Expand Down Expand Up @@ -83,12 +87,14 @@ int main(int /*argc*/, char** /*argv*/)
if (s1.str() != "termcolor")
return 1;

#ifndef NO_ANSI_ESCAPE_SEQUENCES
// test ansi escape characters are preserved for streams if asked
std::stringstream s2;
s2 << colorize << red << "term" << nocolorize << blue << "color";

if (s2.str() != "\033[31m" "termcolor")
return 2;
#endif // NO_ANSI_ESCAPE_SEQUENCES

return 0;
}

0 comments on commit 5724206

Please sign in to comment.