Merge pull request #13 from jpetso/build_ci
authorJakob Petsovits <jpetso@users.noreply.github.com>
Mon, 18 Jan 2016 18:04:14 +0000 (13:04 -0500)
committerJakob Petsovits <jpetso@users.noreply.github.com>
Mon, 18 Jan 2016 18:04:14 +0000 (13:04 -0500)
Build with Travis CI.

.travis.yml [new file with mode: 0644]
CMakeLists.txt
README.md

diff --git a/.travis.yml b/.travis.yml
new file mode 100644 (file)
index 0000000..69b9a0a
--- /dev/null
@@ -0,0 +1,88 @@
+language: cpp
+
+# sources  list: https://github.com/travis-ci/apt-source-whitelist/blob/master/ubuntu.json,
+# packages list: https://github.com/travis-ci/apt-package-whitelist/blob/master/ubuntu-precise
+
+matrix:
+  include:
+    - os: linux
+      compiler: gcc
+      addons:
+        apt:
+          sources: [ 'ubuntu-toolchain-r-test', 'kalakris-cmake' ]
+          packages: [ 'g++-4.8', 'libstdc++-4.8-dev', 'cmake' ]
+      env: CMAKE_BUILD_TYPE=DEBUG GXX=4.8
+
+    - os: linux
+      compiler: gcc
+      addons:
+        apt:
+          sources: [ 'ubuntu-toolchain-r-test', 'kalakris-cmake' ]
+          packages: [ 'g++-4.8', 'libstdc++-4.8-dev', 'cmake' ]
+      env: CMAKE_BUILD_TYPE=RELEASE GXX=4.8
+
+    - os: linux
+      compiler: gcc
+      addons:
+        apt:
+          sources: [ 'ubuntu-toolchain-r-test', 'kalakris-cmake' ]
+          packages: [ 'g++-4.9', 'libstdc++-4.9-dev', 'cmake' ]
+      env: CMAKE_BUILD_TYPE=DEBUG GXX=4.9
+
+    - os: linux
+      compiler: gcc
+      addons:
+        apt:
+          sources: [ 'ubuntu-toolchain-r-test', 'kalakris-cmake' ]
+          packages: [ 'g++-4.9', 'libstdc++-4.9-dev', 'cmake' ]
+      env: CMAKE_BUILD_TYPE=RELEASE GXX=4.9
+
+    - os: linux
+      compiler: gcc
+      addons:
+        apt:
+          sources: [ 'ubuntu-toolchain-r-test', 'kalakris-cmake' ]
+          packages: [ 'g++-5', 'libstdc++-5-dev', 'cmake' ]
+      env: CMAKE_BUILD_TYPE=DEBUG GXX=5
+
+    - os: linux
+      compiler: gcc
+      addons:
+        apt:
+          sources: [ 'ubuntu-toolchain-r-test', 'kalakris-cmake' ]
+          packages: [ 'g++-5', 'libstdc++-5-dev', 'cmake' ]
+      env: CMAKE_BUILD_TYPE=RELEASE GXX=5
+
+    - os: linux
+      compiler: clang
+      addons:
+        apt:
+          sources: [ 'ubuntu-toolchain-r-test', 'kalakris-cmake' ]
+          packages: [ 'libstdc++-4.8-dev', 'cmake' ]
+      env: CMAKE_BUILD_TYPE=DEBUG
+
+    - os: linux
+      compiler: clang
+      addons:
+        apt:
+          sources: [ 'ubuntu-toolchain-r-test', 'kalakris-cmake' ]
+          packages: [ 'libstdc++-4.8-dev', 'cmake' ]
+      env: CMAKE_BUILD_TYPE=RELEASE
+
+# container-based builds
+sudo: false
+
+before_install:
+  - env
+  - export SRC_DIR="`pwd`"
+  - if [ "$CXX" = "g++" ]; then export CXX="g++-$GXX" CC="gcc-$GXX"; fi
+
+script:
+  - $CXX --version
+  - cmake --version
+  - mkdir "$TRAVIS_BUILD_DIR/build"
+  - cd "$TRAVIS_BUILD_DIR/build"
+  - pwd
+  - cmake "$SRC_DIR"
+  - make
+  - CTEST_OUTPUT_ON_FAILURE=1 make test
index 1f617e2..d7ca3b4 100644 (file)
@@ -37,6 +37,7 @@ add_library(cppcodec OBJECT ${PUBLIC_HEADERS}) # unnecessary for building, but m
 add_subdirectory(tool)
 
 if (build_tests)
+    enable_testing()
     add_subdirectory(test)
 endif()
 
index dc5dd90..37bee45 100644 (file)
--- a/README.md
+++ b/README.md
@@ -1,5 +1,7 @@
 # cppcodec
 
+[![Build Status](https://travis-ci.org/tplgy/cppcodec.png)](https://travis-ci.org/tplgy/cppcodec)
+
 Header-only C++11 library to encode/decode base64 (standard, URL-safe),
 base32 (RFC 4648, Crockford) and hex (a.k.a. base16). MIT licensed with
 consistent, flexible API. Supports raw pointers, `std::string` and