From c5822f1c11d5c974a54577edbc0e2c0e3b01cfc3 Mon Sep 17 00:00:00 2001 From: amallia Date: Tue, 27 Jun 2017 21:09:53 +0100 Subject: [PATCH] Added Travis file for CI --- .travis.yml | 17 +++++++++++++++++ CMakeLists.txt | 3 ++- test/CMakeLists.txt | 2 +- 3 files changed, 20 insertions(+), 2 deletions(-) create mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..453d717 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,17 @@ +sudo: false +dist: trusty + +language: cpp + +cache: + apt: true + +addons: + apt: + packages: + - g++ +compiler: + - g++ + +script: mkdir build && cd build && cmake .. && make && ctest --verbose && cd .. + diff --git a/CMakeLists.txt b/CMakeLists.txt index 5499612..7a912ca 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,6 @@ # -- Project Setup ------------------------------------------------------------ -project(libbf CXX) +project(libbf CXX C) include(CTest) @@ -47,6 +47,7 @@ set(CMAKE_CXX_FLAGS_DEBUG "-O0 -g") set(CMAKE_CXX_FLAGS_MINSIZEREL "-Os -DNDEBUG") set(CMAKE_CXX_FLAGS_RELEASE "-O3 -DNDEBUG") set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -g") +set(CMAKE_EXE_LINKER_FLAGS "-pthread") if (ENABLE_DEBUG) set(CMAKE_BUILD_TYPE Debug) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index b84f7c7..498b58c 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -3,4 +3,4 @@ add_subdirectory(bf) enable_testing() add_executable(bf-test tests.cpp) target_link_libraries(bf-test libbf ${CMAKE_THREAD_LIBS_INIT}) -add_test(unit ${CMAKE_CURRENT_BINARY_DIR}/bf-test) +add_test(NAME unit COMMAND bf-test)