Commit 5fe1c8e324205ced2570017b90ddbbd3f8c04b12

Authored by Hayk Martirosyan
Committed by GitHub
2 parents 74bf7b49 9f6d5096

Merge pull request #47 from hmartiro/feature/travis-ci

Feature/travis ci
.travis.yml 0 → 100644
  1 +# Enable C++ support
  2 +language: cpp
  3 +# OS
  4 +sudo: required
  5 +dist: trusty
  6 +# Compiler selection
  7 +compiler:
  8 + - clang
  9 + - gcc
  10 +# Build steps
  11 +script: ./make-ci.sh
CMakeLists.txt
@@ -108,7 +108,7 @@ if (tests) @@ -108,7 +108,7 @@ if (tests)
108 add_executable(test_redox test/test.cpp) 108 add_executable(test_redox test/test.cpp)
109 109
110 target_include_directories(test_redox PUBLIC ${GTEST_INCLUDE_DIRS}) 110 target_include_directories(test_redox PUBLIC ${GTEST_INCLUDE_DIRS})
111 - target_link_libraries(test_redox redox gtest) 111 + target_link_libraries(test_redox redox ${GTEST_BOTH_LIBRARIES})
112 112
113 # So that we can run 'make test' 113 # So that we can run 'make test'
114 add_test(test_redox test_redox) 114 add_test(test_redox test_redox)
@@ -149,7 +149,7 @@ if (examples) @@ -149,7 +149,7 @@ if (examples)
149 149
150 add_executable(binary_data_publish examples/binary_data_publish.cpp) 150 add_executable(binary_data_publish examples/binary_data_publish.cpp)
151 target_link_libraries(binary_data_publish redox) 151 target_link_libraries(binary_data_publish redox)
152 - 152 +
153 add_executable(pub_sub examples/pub_sub.cpp) 153 add_executable(pub_sub examples/pub_sub.cpp)
154 target_link_libraries(pub_sub redox) 154 target_link_libraries(pub_sub redox)
155 155
README.md
@@ -2,6 +2,8 @@ redox @@ -2,6 +2,8 @@ redox
2 ====== 2 ======
3 3
4 Modern, asynchronous, and wicked fast C++11 client for Redis 4 Modern, asynchronous, and wicked fast C++11 client for Redis
  5 +[![Build Status](https://travis-ci.org/hmartiro/redox.svg?branch=feature%2Ftravis-ci)]
  6 +(https://travis-ci.org/hmartiro/redox)
5 7
6 Redox is a C++ interface to the 8 Redox is a C++ interface to the
7 [Redis](http://redis.io/) key-value store that makes it easy to write applications 9 [Redis](http://redis.io/) key-value store that makes it easy to write applications
make-ci.sh 0 → 100755
  1 +#!/usr/bin/env bash
  2 +# Build script for continuous integration
  3 +set -ev
  4 +env | sort
  5 +
  6 +# Install packages
  7 +sudo apt-get update
  8 +sudo apt-get install -y libhiredis-dev libev-dev libgtest-dev redis-server
  9 +
  10 +# Clean
  11 +rm -rf build
  12 +mkdir build
  13 +cd build
  14 +
  15 +# Make gtest
  16 +git clone https://github.com/google/googletest
  17 +cd googletest
  18 +mkdir build
  19 +cd build
  20 +cmake -DBUILD_GMOCK=OFF -DBUILD_GTEST=ON -DBUILD_SHARED_LIBS=ON ..
  21 +time make
  22 +cd ../..
  23 +sudo cp googletest/build/googletest/libg* /usr/local/lib/
  24 +sudo cp -r googletest/googletest/include/gtest /usr/local/include
  25 +
  26 +# Make redox
  27 +cmake -Dexamples=ON -Dlib=ON -Dstatic_lib=ON -Dtests=ON ..
  28 +time make VERBOSE=1
  29 +
  30 +# Test redox
  31 +sudo service redis-server restart
  32 +./test_redox
  33 +cd ..
  1 +#!/usr/bin/env bash
1 mkdir -p build && 2 mkdir -p build &&
2 cd build && 3 cd build &&
3 cmake .. && 4 cmake .. &&
test/test.cpp
@@ -20,8 +20,9 @@ @@ -20,8 +20,9 @@
20 20
21 #include <iostream> 21 #include <iostream>
22 22
  23 +#include <gtest/gtest.h>
  24 +
23 #include "redox.hpp" 25 #include "redox.hpp"
24 -#include "gtest/gtest.h"  
25 26
26 namespace { 27 namespace {
27 28