aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGabriel Dos Reis <gdr-at-ms@users.noreply.github.com>2015-09-24 13:34:21 -0700
committerGabriel Dos Reis <gdr-at-ms@users.noreply.github.com>2015-09-24 13:34:21 -0700
commit0a88570c268d9d11f50a1e7c2b466c0823a52431 (patch)
tree258a7e24a5098417248e6f96a000cdf17539014f
parent2ae46395fa1760638bb4aafe5e69543044e140fb (diff)
parent9b454b7a9bc2ff2c608dcb66c4dfccdc1c40e150 (diff)
downloadplatform_external_Microsoft-GSL-0a88570c268d9d11f50a1e7c2b466c0823a52431.tar.gz
platform_external_Microsoft-GSL-0a88570c268d9d11f50a1e7c2b466c0823a52431.tar.bz2
platform_external_Microsoft-GSL-0a88570c268d9d11f50a1e7c2b466c0823a52431.zip
Merge pull request #29 from tamaskenez/master
add travis testing (gcc5, clang36)
-rw-r--r--.travis.yml67
-rw-r--r--CMakeLists.txt6
-rw-r--r--README.md18
-rw-r--r--tests/CMakeLists.txt10
4 files changed, 84 insertions, 17 deletions
diff --git a/.travis.yml b/.travis.yml
new file mode 100644
index 0000000..524f1fb
--- /dev/null
+++ b/.travis.yml
@@ -0,0 +1,67 @@
+# Based on https://github.com/ldionne/hana/blob/master/.travis.yml
+
+language: cpp
+sudo: false
+
+matrix:
+ include:
+ - env: COMPILER=clang++-3.6 BUILD_TYPE=Debug CLANG=1
+ compiler: clang
+ addons: &clang36
+ apt:
+ packages:
+ - clang-3.6
+ - cmake
+ sources: &sources
+ - ubuntu-toolchain-r-test
+ - llvm-toolchain-precise-3.6
+ - kalakris-cmake
+ - env: COMPILER=clang++-3.6 BUILD_TYPE=Release CLANG=1
+ compiler: clang
+ addons: *clang36
+ - env: COMPILER=g++-5 BUILD_TYPE=Debug
+ compiler: gcc
+ addons: &gcc5
+ apt:
+ packages: g++-5
+ sources: *sources
+ - env: COMPILER=g++-5 BUILD_TYPE=Release
+ compiler: gcc
+ addons: *gcc5
+
+install:
+ - which $COMPILER
+ - DEPS_DIR="${TRAVIS_BUILD_DIR}/deps"
+ - mkdir ${DEPS_DIR} && cd ${DEPS_DIR}
+ - |
+ if [[ "$CLANG" == 1 && "${TRAVIS_OS_NAME}" == "linux" && "${STDLIB}" != "libstdc++" ]]; then
+ if [[ "${COMPILER}" == "clang++-3.5" ]]; then LLVM_VERSION="3.5.2"; fi
+ if [[ "${COMPILER}" == "clang++-3.6" ]]; then LLVM_VERSION="3.6.2"; fi
+ if [[ "${COMPILER}" == "clang++-3.7" ]]; then LLVM_VERSION="3.7.0"; fi
+ LLVM_URL="http://llvm.org/releases/${LLVM_VERSION}/llvm-${LLVM_VERSION}.src.tar.xz"
+ LIBCXX_URL="http://llvm.org/releases/${LLVM_VERSION}/libcxx-${LLVM_VERSION}.src.tar.xz"
+ LIBCXXABI_URL="http://llvm.org/releases/${LLVM_VERSION}/libcxxabi-${LLVM_VERSION}.src.tar.xz"
+ mkdir -p llvm llvm/build llvm/projects/libcxx llvm/projects/libcxxabi
+ travis_retry wget --quiet -O - ${LLVM_URL} | tar --strip-components=1 -xJ -C llvm
+ travis_retry wget --quiet -O - ${LIBCXX_URL} | tar --strip-components=1 -xJ -C llvm/projects/libcxx
+ travis_retry wget --quiet -O - ${LIBCXXABI_URL} | tar --strip-components=1 -xJ -C llvm/projects/libcxxabi
+ (cd llvm/build && cmake .. -DCMAKE_INSTALL_PREFIX=${DEPS_DIR}/llvm/install -DCMAKE_CXX_COMPILER=clang++)
+ (cd llvm/build/projects/libcxx && make install -j2)
+ (cd llvm/build/projects/libcxxabi && make install -j2)
+ export CXXFLAGS="-I ${DEPS_DIR}/llvm/install/include/c++/v1"
+ export LDFLAGS="-L ${DEPS_DIR}/llvm/install/lib -l c++ -l c++abi"
+ export LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:${DEPS_DIR}/llvm/install/lib"
+ fi
+
+before_script:
+ - cd ${TRAVIS_BUILD_DIR}
+ - git clone --depth 1 https://github.com/Microsoft/unittest-cpp tests/unittest-cpp
+ - cmake -H. -Bb -DCMAKE_CXX_COMPILER=$COMPILER -DCMAKE_INSTALL_PREFIX=$PWD/o -DCMAKE_BUILD_TYPE=$BUILD_TYPE
+ - cmake --build b
+
+script:
+ - cd b
+ - ctest
+
+notifications:
+ email: false
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 2125f7b..f8145d6 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,6 +1,6 @@
-cmake_minimum_required(VERSION 3.2.2)
+cmake_minimum_required(VERSION 2.8.7)
-project(GSL)
+project(GSL CXX)
include_directories(
${CMAKE_CURRENT_BINARY_DIR}
@@ -8,4 +8,4 @@ include_directories(
enable_testing()
-add_subdirectory(tests) \ No newline at end of file
+add_subdirectory(tests)
diff --git a/README.md b/README.md
index 506110f..a32e89f 100644
--- a/README.md
+++ b/README.md
@@ -1,7 +1,7 @@
-# GSL: Guidelines Support Library
+# GSL: Guidelines Support Library [![Build Status](https://travis-ci.org/Microsoft/GSL.svg?branch=master)](https://travis-ci.org/Microsoft/GSL)
The Guidelines Support Library (GSL) contains functions and types that are suggested for use by the
-[C++ Core Guidelines](https://github.com/isocpp/CppCoreGuidelines) maintained by the [Standard C++ Foundation](https://isocpp.org).
+[C++ Core Guidelines](https://github.com/isocpp/CppCoreGuidelines) maintained by the [Standard C++ Foundation](https://isocpp.org).
This repo contains Microsoft's implementation of GSL.
The library includes types like `array_view<>`, `string_view<>`, `owner<>` and others.
@@ -12,7 +12,7 @@ While some types have been broken out into their own headers (e.g. [include/arra
it is simplest to just include [gsl.h](./include/gsl.h) and gain access to the entire library.
> NOTE: We encourage contributions that improve or refine any of the types in this library as well as ports to
-other platforms. Please see [CONTRIBUTING.md](./CONTRIBUTING.md) for more information about contributing.
+other platforms. Please see [CONTRIBUTING.md](./CONTRIBUTING.md) for more information about contributing.
# Quick Start
## Supported Platforms
@@ -27,13 +27,13 @@ The test suite that exercises GSL has been built and passes successfully on the
* OS X Yosemite using Xcode with AppleClang 7.0.0.7000072
* OS X Yosemite using GCC-5.2.0
-> If you successfully port GSL to another platform, we would love to hear from you. Please submit an issue to let us know. Also please consider
-contributing any changes that were necessary back to this project to benefit the wider community.
+> If you successfully port GSL to another platform, we would love to hear from you. Please submit an issue to let us know. Also please consider
+contributing any changes that were necessary back to this project to benefit the wider community.
## Building the tests
To build the tests, you will require the following:
-* [CMake](http://cmake.org), version 3.3 or later to be installed and in your PATH.
+* [CMake](http://cmake.org), version 2.8.7 or later to be installed and in your PATH.
* [UnitTest-cpp](https://github.com/Microsoft/unittest-cpp), to be cloned under the [tests/unittest-cpp](./tests/unittest-cpp) directory
of your GSL source.
@@ -46,13 +46,13 @@ These steps assume the source code of this repository has been cloned into a dir
cd build-x86
2. Configure CMake to use the compiler of your choice (you can see a list by running `cmake --help`).
-
+
cmake -G "Visual Studio 14 2015" c:\GSL
-
+
3. Build the test suite (in this case, in the Debug configuration, Release is another good choice).
cmake --build . --config Debug
-
+
4. Run the test suite.
ctest -C Debug
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
index ad7a38c..0415db3 100644
--- a/tests/CMakeLists.txt
+++ b/tests/CMakeLists.txt
@@ -1,6 +1,6 @@
-cmake_minimum_required(VERSION 3.2.2)
+cmake_minimum_required(VERSION 2.8.7)
-project(GSLTests)
+project(GSLTests CXX)
add_subdirectory(unittest-cpp)
@@ -23,7 +23,7 @@ else()
elseif(COMPILER_SUPPORTS_CXX11)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
else()
- message(STATUS "The compiler ${CMAKE_CXX_COMPILER} has no C++11 support. Please use a different C++ compiler.")
+ message(STATUS "The compiler ${CMAKE_CXX_COMPILER} has no C++11 support. Please use a different C++ compiler.")
endif()
endif()
@@ -38,8 +38,8 @@ function(add_gsl_test name)
RUNTIME DESTINATION bin
)
add_test(
- NAME ${name}
- COMMAND ${name}
+ ${name}
+ ${name}
)
endfunction()