Skip to content

Commit

Permalink
Add Travis CI that ensures compilation success
Browse files Browse the repository at this point in the history
Despite I don't know how to test that colors are really applied to
terminal, it would be really nice to have at least a simple test
that ensures that we still can compile a test project without
errors.

"-c++=11" compilation flag is removed, since we don't use this
standard and Linux on Travis CI doesn't have appropriate GCC version.
  • Loading branch information
Igor Kalnitsky committed Jun 26, 2016
1 parent 09c709f commit 252e166
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 2 deletions.
18 changes: 18 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
sudo: false
language: cpp

os:
- linux
- osx

compiler:
- clang
- gcc

script:
- mkdir build/ && cd build/
- cmake ../ -DCMAKE_BUILD_TYPE=Release
- make

notifications:
email: false
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ if (${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang")
endif (${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang")

if (CMAKE_COMPILER_IS_GNUCXX OR CMAKE_COMPILER_IS_CLANG)
set (CMAKE_CXX_FLAGS "-Wall -Wextra -pedantic -fvisibility=hidden -std=c++11")
set (CMAKE_CXX_FLAGS "-Wall -Wextra -pedantic -fvisibility=hidden")
set (CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_INIT} -g")
set (CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_INIT} -O2")
endif (CMAKE_COMPILER_IS_GNUCXX OR CMAKE_COMPILER_IS_CLANG)
Expand Down
2 changes: 1 addition & 1 deletion include/termcolor/termcolor.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,7 @@ namespace termcolor
else if ((&stream == &std::cerr) || (&stream == &std::clog))
return stderr;

return nullptr;
return 0;
}


Expand Down

0 comments on commit 252e166

Please sign in to comment.