Skip to content

Commit

Permalink
Merge pull request datastax#74 from datastax/travis-ci
Browse files Browse the repository at this point in the history
C++11 Features Removed from Tests (Boost) and Travis-CI Integration
  • Loading branch information
mpenick committed Oct 10, 2014
2 parents 9b0c5c1 + 48d70b2 commit 4521002
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 3 deletions.
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -67,5 +67,13 @@ Doxyfile
*.suo
*.opensdf

# Travis Build Dependencies
libuv-v*
lib/libuv/include/**
!lib/libuv/include/README
lib/libuv/lib/**
!lib/libuv/lib/README
boost_1_*


config*.txt
16 changes: 16 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
language: c++
compiler: gcc
before_install:
- sudo apt-get update -qq
- sudo apt-get install libssl-dev libssh2-1-dev -qq
- wget -q http://libuv.org/dist/v0.10.28/libuv-v0.10.28.tar.gz
- wget -q http://sourceforge.net/projects/boost/files/boost/1.55.0/boost_1_55_0.tar.gz/download -O boost_1_55_0.tar.gz
install:
- tar xzf libuv-v0.10.28.tar.gz
- cd libuv-v0.10.28 && make -s && cd - 2&> /dev/null && cp -r libuv-v0.10.28/libuv.a libuv-v0.10.28/libuv.so lib/libuv/lib && cd lib/libuv/lib && ln -sf libuv.so libuv.so.0.10 && cd - 2&> /dev/null && cp -r libuv-v0.10.28/include/* lib/libuv/include
- tar xzf boost_1_55_0.tar.gz
- cd boost_1_55_0 && ./bootstrap.sh --with-libraries=chrono,date_time,log,program_options,system,thread,test && sudo ./b2 install --prefix=/usr -d0 && cd - 2&> /dev/null
before_script: cmake -DLIBUV_ROOT_DIR=lib/libuv/ .
script:
- make
- test/unit_tests/cassandra_unit_tests
8 changes: 7 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ endif()
set(MULTICORE_CORES_NUMBER "3" CACHE STRING "Number of cores (for multicore compilation)")
option(MULTICORE_COMPILATION "Enable multicore compilation" OFF)

set(TEST_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DBOOST_THREAD_USES_MOVE")
set(TEST_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DBOOST_THREAD_USES_MOVE -DBOOST_NO_CXX11_RVALUE_REFERENCES")

if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
if(MULTICORE_COMPILATION)
Expand Down Expand Up @@ -125,6 +125,12 @@ if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
add_definitions(-DBOOST_ALL_NO_LIB)
add_definitions(-DNOMINMAX)
elseif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
# CMAKE_CXX_COMPILER variables do not exist in 2.6.4 (min version)
# Parse the -dumpversion argument into the variable not already set
if ("${CMAKE_CXX_COMPILER_VERSION}" STREQUAL "")
execute_process(COMMAND ${CMAKE_C_COMPILER} -dumpversion OUTPUT_VARIABLE CMAKE_CXX_COMPILER_VERSION)
endif()

# GCC specific compiler options
# I disabled long-long warning because boost generates about 50 such warnings
set(WARNING_COMPILER_FLAGS "-Wall -pedantic -Wextra -Werror -Wno-long-long -Wno-deprecated-declarations -Wno-unused-parameter")
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
DataStax C/C++ Driver for Apache Cassandra (Beta)
===============================================

[![Build Status](https://travis-ci.org/datastax/cpp-driver.svg?branch=travis-ci)](https://travis-ci.org/datastax/cpp-driver)

A C/C++ client driver for Apache Cassandra. This driver works exclusively with
the Cassandra Query Language version 3 (CQL3) and Cassandra's Binary Protocol (version 1 and 2).

Expand Down
4 changes: 2 additions & 2 deletions test/integration_tests/src/prepared.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ BOOST_AUTO_TEST_CASE(test_bound_all_types_different_values)
all_types[0].id = test_utils::generate_time_uuid();
all_types[0].text_sample = cass_string_init("first");
all_types[0].int_sample = 10;
all_types[0].bigint_sample = INT64_MAX - 1L;
all_types[0].bigint_sample = std::numeric_limits<int64_t>::max() - 1L;
all_types[0].float_sample = 1.999f;
all_types[0].double_sample = 32.002;
all_types[0].decimal_sample = cass_decimal_init(1, cass_bytes_init(varint1, sizeof(varint1)));
Expand All @@ -204,7 +204,7 @@ BOOST_AUTO_TEST_CASE(test_bound_all_types_different_values)
all_types[2].id = test_utils::generate_time_uuid();
all_types[2].text_sample = cass_string_init("third");
all_types[2].int_sample = -100;
all_types[2].bigint_sample = INT64_MIN + 1;
all_types[2].bigint_sample = std::numeric_limits<int64_t>::min() + 1;
all_types[2].float_sample = -150.111f;
all_types[2].double_sample = -5.12342;
all_types[2].decimal_sample = cass_decimal_init(3, cass_bytes_init(varint3, sizeof(varint3)));
Expand Down
1 change: 1 addition & 0 deletions test/unit_tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ file(GLOB UNIT_TESTS_SRC_FILES ${PROJECT_SOURCE_DIR}/test/unit_tests/src/*.cpp)
set(INCLUDES ${PROJECT_INCLUDE_DIR})
set(INCLUDES ${INCLUDES} "${PROJECT_SOURCE_DIR}/src")
set(INCLUDES ${INCLUDES} ${Boost_INCLUDE_DIRS})
set(INCLUDES ${INCLUDES} ${LIBUV_INCLUDE_DIR})

# Create source groups - this is only needed to create
# neat folder structure in Visual Studio...
Expand Down

0 comments on commit 4521002

Please sign in to comment.