diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..2c384ba --- /dev/null +++ b/.travis.yml @@ -0,0 +1,46 @@ +language: cpp + +dist: trusty # default distribution +os: linux # default os +sudo: false + + +matrix: + fast_finish: true + include: + - env: CC=gcc-5 CXX=g++-5 GENERATOR="Unix Makefiles" + addons: { apt: { packages: ["g++-5"], sources: ["ubuntu-toolchain-r-test"] } } + + - env: CC=gcc-6 CXX=g++-6 GENERATOR="Unix Makefiles" + addons: { apt: { packages: ["g++-6"], sources: ["ubuntu-toolchain-r-test"] } } + + - env: CC=gcc-7 CXX=g++-7 GENERATOR="Unix Makefiles" + addons: { apt: { packages: ["g++-7"], sources: ["ubuntu-toolchain-r-test"] } } + + - env: CC=gcc-8 CXX=g++-8 GENERATOR="Unix Makefiles" + addons: { apt: { packages: ["g++-8"], sources: ["ubuntu-toolchain-r-test"] } } + + - env: CC=clang-5.0 CXX=clang++-5.0 GENERATOR="Unix Makefiles" + addons: { apt: { packages: ["g++-8", "clang-5.0"], sources: ["llvm-toolchain-trusty-5.0", "ubuntu-toolchain-r-test"] } } + + - env: CC=clang-6.0 CXX=clang++-6.0 GENERATOR="Unix Makefiles" + addons: { apt: { packages: ["g++-8", "clang-6.0"], sources: ["llvm-toolchain-trusty-6.0", "ubuntu-toolchain-r-test"] } } + + - os: osx + env: CC=clang CXX=clang++ GENERATOR="Xcode" + osx_image: xcode9.2 + +install: + - $CC --version + - $CXX --version + - cmake --version + +before_script: + - mkdir build + - cd build + - cmake -G${GENERATOR} -DCMAKE_CXX_COMPILER=${CXX} -DCMAKE_C_COMPILER=${CC} .. + +script: + - cmake --build . --config Release + - ctest + diff --git a/CMakeLists.txt b/CMakeLists.txt index a45f209..30f2947 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -25,6 +25,7 @@ target_compile_options(ghc_filesystem INTERFACE "$<$:/utf- get_directory_property(hasParent PARENT_DIRECTORY) if(NOT hasParent) + enable_testing() add_subdirectory(test) add_subdirectory(examples) endif() diff --git a/README.md b/README.md index 8c38bb1..06ecd6b 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,5 @@ +[![Build Status](https://travis-ci.org/gulrak/filesystem.svg?branch=master)](https://travis-ci.org/gulrak/filesystem) + # Filesystem This is a header-only single-file std::filesystem compatible helper library, @@ -200,7 +202,7 @@ that use this technique, so you can simply include them if you want to dynamical the filesystem implementation. -### Git Submodule +### Git Submodule and CMake Starting from v1.1.0, it is possible to add `ghc::filesystem` as a git submodule, add the directory to your `CMakeLists.txt` with diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index df2dfd2..0bfbb32 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -13,6 +13,7 @@ if(CMAKE_GENERATOR STREQUAL Xcode) target_compile_options(filesystem_test_cov PRIVATE "$<$:--coverage>") target_link_libraries(filesystem_test_cov PUBLIC ghc_filesystem PRIVATE --coverage) endif() +add_test(filesystem_test filesystem_test) if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" AND (CMAKE_CXX_COMPILER_VERSION VERSION_EQUAL 7.0 OR CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 7.0)) if(APPLE) @@ -39,9 +40,11 @@ endif() add_executable(multifile_test multi1.cpp multi2.cpp catch.hpp) target_link_libraries(multifile_test ghc_filesystem) +add_test(multifile_test multifile_test) add_executable(fwd_impl_test fwd_test.cpp impl_test.cpp) target_link_libraries(fwd_impl_test ghc_filesystem) if(CMAKE_CXX_COMPILER_ID MATCHES MSVC) target_compile_definitions(fwd_impl_test PRIVATE _CRT_SECURE_NO_WARNINGS) endif() +add_test(fwd_impl_test fwd_impl_test)