diff --git a/.gitignore b/.gitignore index 4ac23038a..c54ad97ce 100644 --- a/.gitignore +++ b/.gitignore @@ -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 diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 000000000..9e287236c --- /dev/null +++ b/.travis.yml @@ -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 diff --git a/CMakeLists.txt b/CMakeLists.txt index a803c2cc7..f4cbad228 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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) @@ -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") diff --git a/README.md b/README.md index afd3598ed..28191f575 100644 --- a/README.md +++ b/README.md @@ -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). diff --git a/test/integration_tests/src/prepared.cpp b/test/integration_tests/src/prepared.cpp index 668c5328d..015e996a9 100644 --- a/test/integration_tests/src/prepared.cpp +++ b/test/integration_tests/src/prepared.cpp @@ -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::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))); @@ -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::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))); diff --git a/test/unit_tests/CMakeLists.txt b/test/unit_tests/CMakeLists.txt index 69bc62838..65b5b0789 100644 --- a/test/unit_tests/CMakeLists.txt +++ b/test/unit_tests/CMakeLists.txt @@ -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...