Skip to content

Commit

Permalink
add travis ci, appveyor, coveralls
Browse files Browse the repository at this point in the history
  • Loading branch information
Pavel Belikov committed Nov 6, 2017
1 parent 6912a56 commit b55cd27
Show file tree
Hide file tree
Showing 8 changed files with 9,448 additions and 7,681 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ test*
/ld

# Executable
/build/
CMakeCache.txt
CMakeFiles
cmake_install.cmake
Expand Down
150 changes: 150 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,150 @@
language: cpp
dist: trusty
matrix:
include:
- os: linux
addons:
apt:
sources: ['ubuntu-toolchain-r-test']
packages: ['g++-4.9']
env: COMPILER=g++-4.9 CONFIG=Release FLAGS='--coverage' COVERAGE=1

- os: linux
addons:
apt:
sources: ['ubuntu-toolchain-r-test']
packages: ['g++-4.9']
env: COMPILER=g++-4.9 CONFIG=Debug

- os: linux
addons:
apt:
sources: ['ubuntu-toolchain-r-test']
packages: ['g++-5']
env: COMPILER=g++-5 CONFIG=Release

- os: linux
addons:
apt:
sources: ['ubuntu-toolchain-r-test']
packages: ['g++-5']
env: COMPILER=g++-5 CONFIG=Debug

- os: linux
addons:
apt:
sources: ['ubuntu-toolchain-r-test']
packages: ['g++-6']
env: COMPILER=g++-6 CONFIG=Release

- os: linux
addons:
apt:
sources: ['ubuntu-toolchain-r-test']
packages: ['g++-6']
env: COMPILER=g++-6 CONFIG=Debug

- os: linux
addons:
apt:
sources: ['llvm-toolchain-precise-3.5', 'ubuntu-toolchain-r-test']
packages: ['clang++-3.5']
env: COMPILER=clang++-3.5 CONFIG=Release

- os: linux
addons:
apt:
sources: ['llvm-toolchain-precise-3.5', 'ubuntu-toolchain-r-test']
packages: ['clang++-3.5']
env: COMPILER=clang++-3.5 CONFIG=Debug

- os: linux
addons:
apt:
sources: ['llvm-toolchain-precise-3.6', 'ubuntu-toolchain-r-test']
packages: ['clang++-3.6']
env: COMPILER=clang++-3.6 CONFIG=Release

- os: linux
addons:
apt:
sources: ['llvm-toolchain-precise-3.6', 'ubuntu-toolchain-r-test']
packages: ['clang++-3.6']
env: COMPILER=clang++-3.6 CONFIG=Debug

- os: linux
addons:
apt:
sources: ['llvm-toolchain-precise-3.7', 'ubuntu-toolchain-r-test']
packages: ['clang++-3.7']
env: COMPILER=clang++-3.7 CONFIG=Release

- os: linux
addons:
apt:
sources: ['llvm-toolchain-precise-3.7', 'ubuntu-toolchain-r-test']
packages: ['clang++-3.7']
env: COMPILER=clang++-3.7 CONFIG=Debug

- os: linux
addons:
apt:
sources: ['llvm-toolchain-precise-3.8', 'ubuntu-toolchain-r-test']
packages: ['clang++-3.8']
env: COMPILER=clang++-3.8 CONFIG=Release

- os: linux
addons:
apt:
sources: ['llvm-toolchain-precise-3.8', 'ubuntu-toolchain-r-test']
packages: ['clang++-3.8']
env: COMPILER=clang++-3.8 CONFIG=Debug

- os: linux
addons:
apt:
sources: ['llvm-toolchain-precise-3.9', 'ubuntu-toolchain-r-test']
packages: ['clang++-3.9']
env: COMPILER=clang++-3.9 CONFIG=Release

- os: linux
addons:
apt:
sources: ['llvm-toolchain-precise-3.9', 'ubuntu-toolchain-r-test']
packages: ['clang++-3.9']
env: COMPILER=clang++-3.9 CONFIG=Debug

- os: osx
osx_image: xcode7.3
compiler: clang
env: COMPILER=clang++ CONFIG=Release

- os: osx
osx_image: xcode7.3
compiler: clang
env: COMPILER=clang++ CONFIG=Debug

- os: osx
osx_image: xcode8
compiler: clang
env: COMPILER=clang++ CONFIG=Release

- os: osx
osx_image: xcode8
compiler: clang
env: COMPILER=clang++ CONFIG=Debug

script:
- mkdir build
- cd build
- cmake -DCMAKE_BUILD_TYPE="${CONFIG}" -DCMAKE_CXX_COMPILER="${COMPILER}" -DCMAKE_CXX_FLAGS="${FLAGS}" ..
- make
- ctest -V

before_install:
- pip install --user cpp-coveralls

after_success:
- if [ "${COVERAGE}" = 1 ]; then coveralls --root .. -E ".*catch.*" -E ".*CMakeFiles.*" -E ".*gitlike.cxx.*" -E ".*test.cxx.*"; fi


39 changes: 39 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Copyright (c) 2016-2017 Taylor C. Richberger <[email protected]> and Pavel
# Belikov
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to
# deal in the Software without restriction, including without limitation the
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
# sell copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
# IN THE SOFTWARE.

cmake_minimum_required(VERSION 3.2)
project(args CXX)

add_library(args INTERFACE)
target_include_directories(args INTERFACE "${CMAKE_CURRENT_SOURCE_DIR}")

add_executable(argstest test.cxx)
target_link_libraries(argstest args)
set_property(TARGET argstest PROPERTY CXX_STANDARD 11)

if (MSVC)
target_compile_options(argstest PRIVATE /W4 /WX)
else ()
target_compile_options(argstest PRIVATE -Wall -Wextra -Werror -pedantic -Wshadow -Wunused-parameter)
endif ()

enable_testing()
add_test(NAME "test" COMMAND argstest)
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
#### Note that this library is essentially in maintenance mode. I haven't had the time to work on it or give it the love that it deserves. I'm not adding new features, but I will fix bugs. I will also very gladly accept pull requests.

[![build status](https://gitgud.io/Taywee/args/badges/master/build.svg)](https://gitgud.io/Taywee/args/commits/master)
[![build status](https://travis-ci.org/pavel-belikov/args.svg?branch=master)](https://travis-ci.org/pavel-belikov/args)
[![Build status](https://ci.appveyor.com/api/projects/status/976ht5hvt14wq78n?svg=true)](https://ci.appveyor.com/project/pavel-belikov/args)
[![Coverage Status](https://coveralls.io/repos/github/pavel-belikov/args/badge.svg)](https://coveralls.io/github/pavel-belikov/args)

A simple, small, flexible, single-header C++11 argument parsing library, in
fewer than 2K lines of code.
Expand Down
22 changes: 22 additions & 0 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
os:
- Visual Studio 2017
- Visual Studio 2015

platform:
- Win32
- x64

configuration:
- Debug
- Release

before_build:
- cmake -H. -Bbuild -A%PLATFORM%

build:
project: build\args.sln
verbosity: normal

test_script:
- cd build
- ctest -V -C %CONFIGURATION%
Loading

0 comments on commit b55cd27

Please sign in to comment.