Skip to content

Commit 823ddf7

Browse files
authored
Update travis CI (#49)
1 parent 70b8d01 commit 823ddf7

File tree

5 files changed

+40
-17
lines changed

5 files changed

+40
-17
lines changed

.travis.yml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
1-
os:
2-
- linux
3-
- osx
4-
5-
osx_image: xcode10.1
1+
matrix:
2+
include:
3+
- os: linux
4+
dist: xenial
5+
- os: osx
6+
osx_image: xcode11
67

78
sudo: required
89

9-
dist: xenial
10-
1110
language: cpp
1211

1312
addons:
@@ -20,13 +19,14 @@ addons:
2019
- libssl-dev
2120
- build-essential
2221
- cmake
22+
- libgtest-dev
23+
- libc-ares-dev
2324
homebrew:
2425
packages:
2526
- openssl
2627
- cmake
2728
- libtool
29+
- gtest
2830

2931
script:
30-
- ./build.sh
31-
32-
32+
- ./build.sh -t

CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,15 +84,15 @@ set_property(TARGET trantor PROPERTY CXX_STANDARD 14)
8484
set_property(TARGET trantor PROPERTY CXX_STANDARD_REQUIRED ON)
8585
set_property(TARGET trantor PROPERTY CXX_EXTENSIONS OFF)
8686

87-
if (MAKETEST STREQUAL YES)
87+
if(MAKETEST STREQUAL YES)
8888
add_subdirectory(trantor/tests)
8989
find_package(GTest)
9090
if(GTest_FOUND)
9191
include_directories(${GTEST_INCLUDE_DIRS})
9292
link_libraries(${GTEST_LIBRARIES})
9393
add_subdirectory(trantor/unittests)
9494
endif()
95-
endif ()
95+
endif()
9696

9797
set(public_net_headers
9898
trantor/net/EventLoop.h

build.sh

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,12 @@ function build_trantor() {
2020
echo "Entering folder: ${build_dir}"
2121
cd $build_dir
2222

23-
echo "Start building drogon ..."
24-
cmake ..
23+
echo "Start building trantor ..."
24+
if [ $1 -eq 1 ]; then
25+
cmake .. -DMAKETEST=YES
26+
else
27+
cmake ..
28+
fi
2529

2630
#If errors then exit
2731
if [ "$?" != "0" ]; then
@@ -44,4 +48,8 @@ function build_trantor() {
4448
#Ok!
4549
}
4650

47-
build_trantor
51+
if [ "$1" = "-t" ]; then
52+
build_trantor 1
53+
else
54+
build_trantor 0
55+
fi

trantor/utils/MsgBuffer.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ void MsgBuffer::ensureWritableBytes(size_t len)
8787
newbuffer.append(*this);
8888
swap(newbuffer);
8989
}
90-
void MsgBuffer::swap(MsgBuffer &buf)
90+
void MsgBuffer::swap(MsgBuffer &buf) noexcept
9191
{
9292
_buffer.swap(buf._buffer);
9393
std::swap(_head, buf._head);

trantor/utils/MsgBuffer.h

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ class MsgBuffer
6565
uint16_t readInt16();
6666
uint32_t readInt32();
6767
uint64_t readInt64();
68-
void swap(MsgBuffer &buf);
68+
void swap(MsgBuffer &buf) noexcept;
6969
size_t readableBytes() const
7070
{
7171
return _tail - _head;
@@ -167,4 +167,19 @@ class MsgBuffer
167167
return &_buffer[0];
168168
}
169169
};
170+
171+
inline void swap(MsgBuffer &one, MsgBuffer &two) noexcept
172+
{
173+
one.swap(two);
174+
}
170175
} // namespace trantor
176+
177+
namespace std
178+
{
179+
template <>
180+
inline void swap<trantor::MsgBuffer>(trantor::MsgBuffer &one,
181+
trantor::MsgBuffer &two) noexcept
182+
{
183+
one.swap(two);
184+
}
185+
} // namespace std

0 commit comments

Comments
 (0)