Skip to content

Commit cb897e0

Browse files
committed
Added Travis file for CI
1 parent 802d395 commit cb897e0

File tree

4 files changed

+27
-4
lines changed

4 files changed

+27
-4
lines changed

.travis.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
sudo: false
2+
dist: trusty
3+
4+
language: cpp
5+
6+
cache:
7+
apt: true
8+
9+
addons:
10+
apt:
11+
packages:
12+
- g++
13+
compiler:
14+
- g++
15+
16+
script: mkdir build && cd build && cmake .. && make && ctest --verbose && cd ..
17+

CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# -- Project Setup ------------------------------------------------------------
22

3-
project(libbf CXX)
3+
project(libbf CXX C)
44

55
include(CTest)
66

@@ -47,6 +47,7 @@ set(CMAKE_CXX_FLAGS_DEBUG "-O0 -g")
4747
set(CMAKE_CXX_FLAGS_MINSIZEREL "-Os -DNDEBUG")
4848
set(CMAKE_CXX_FLAGS_RELEASE "-O3 -DNDEBUG")
4949
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -g")
50+
set(CMAKE_EXE_LINKER_FLAGS "-pthread")
5051

5152
if (ENABLE_DEBUG)
5253
set(CMAKE_BUILD_TYPE Debug)

test/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ add_subdirectory(bf)
33
enable_testing()
44
add_executable(bf-test tests.cpp)
55
target_link_libraries(bf-test libbf ${CMAKE_THREAD_LIBS_INIT})
6-
add_test(unit ${CMAKE_CURRENT_BINARY_DIR}/bf-test)
6+
add_test(NAME unit COMMAND bf-test)

test/unit_test_impl.hpp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,12 @@ bool engine::run(bool colorize,
333333
// psv == pipe-separated-values
334334
strvec result;
335335
if (psv != ".*") {
336-
split(result, psv, "|", token_compress_on);
336+
std::istringstream ss(psv);
337+
std::string token;
338+
while( std::getline(ss, token, ',')) {
339+
if(token.size())
340+
result.push_back(token);
341+
}
337342
std::sort(result.begin(), result.end());
338343
}
339344
return result;
@@ -552,7 +557,7 @@ int main(int argc, char** argv) {
552557
break;
553558
}
554559
}
555-
// TODO: convert CAF implementation details to generic ones
560+
// TODO: convert CAF implementation details to generic ones
556561
// our simple command line parser.
557562
//auto res = message_builder(cli_argv, cli_argv + divider - 1).extract_opts({
558563
// {"no-colors,n", "disable coloring"},

0 commit comments

Comments
 (0)