Move benchmarks to a separate project

This commit is contained in:
Vinnie Falco
2017-06-20 15:49:45 -07:00
parent 9c4b3ed2a7
commit 7b8149cfd4
17 changed files with 49 additions and 33 deletions

View File

@@ -1,5 +1,6 @@
# Part of Beast
add_subdirectory (benchmarks)
add_subdirectory (core)
add_subdirectory (http)
add_subdirectory (server)

View File

@@ -14,6 +14,7 @@ compile version.cpp : <variant>coverage:<build>no : ;
compile websocket.cpp : <variant>coverage:<build>no : ;
compile zlib.cpp : <variant>coverage:<build>no : ;
build-project benchmarks ;
build-project core ;
build-project http ;
build-project server ;

View File

@@ -0,0 +1,27 @@
# Part of Beast
if (NOT "${VARIANT}" STREQUAL "coverage")
GroupSources(extras/beast extras)
GroupSources(include/beast beast)
GroupSources(test/benchmarks "/")
GroupSources(test/http "/")
add_executable (benchmarks
${BEAST_INCLUDES}
${EXTRAS_INCLUDES}
../../extras/beast/unit_test/main.cpp
../http/message_fuzz.hpp
nodejs_parser.hpp
buffers.cpp
nodejs_parser.cpp
parser.cpp
)
target_link_libraries(benchmarks
Beast
${Boost_PROGRAM_OPTIONS_LIBRARY}
${Boost_FILESYSTEM_LIBRARY}
)
endif()

15
test/benchmarks/Jamfile Normal file
View File

@@ -0,0 +1,15 @@
#
# Copyright (c) 2013-2017 Vinnie Falco (vinnie dot falco at gmail dot com)
#
# Distributed under the Boost Software License, Version 1.0. (See accompanying
# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#
unit-test benchmarks :
../../extras/beast/unit_test/main.cpp
buffers.cpp
nodejs_parser.cpp
parser.cpp
:
<variant>coverage:<build>no
;

View File

@@ -20,7 +20,7 @@
namespace beast {
class buffer_bench_test : public beast::unit_test::suite
class buffers_test : public beast::unit_test::suite
{
public:
using size_type = std::uint64_t;
@@ -233,8 +233,6 @@ public:
}
};
#if defined(NDEBUG) && ! BEAST_NO_SLOW_TESTS
BEAST_DEFINE_TESTSUITE(buffer_bench,core,beast);
#endif
BEAST_DEFINE_TESTSUITE(buffers,benchmarks,beast);
} // beast

View File

@@ -6,7 +6,7 @@
//
#include "nodejs_parser.hpp"
#include "message_fuzz.hpp"
#include "../http/message_fuzz.hpp"
#include <beast/http.hpp>
#include <beast/core/consuming_buffers.hpp>
@@ -22,7 +22,7 @@
namespace beast {
namespace http {
class parser_bench_test : public beast::unit_test::suite
class parser_test : public beast::unit_test::suite
{
public:
static std::size_t constexpr N = 2000;
@@ -270,7 +270,7 @@ public:
}
};
BEAST_DEFINE_TESTSUITE(parser_bench,http,beast);
BEAST_DEFINE_TESTSUITE(parser,benchmarks,beast);
} // http
} // beast

View File

@@ -12,7 +12,6 @@ add_executable (core-tests
../../extras/beast/unit_test/main.cpp
async_result.cpp
bind_handler.cpp
buffer_bench.cpp
buffer_cat.cpp
buffer_prefix.cpp
buffer_test.hpp

View File

@@ -9,7 +9,6 @@ unit-test core-tests :
../../extras/beast/unit_test/main.cpp
async_result.cpp
bind_handler.cpp
buffer_bench.cpp
buffer_cat.cpp
buffer_prefix.cpp
buffered_read_stream.cpp

View File

@@ -43,21 +43,3 @@ target_link_libraries(http-tests
${Boost_THREAD_LIBRARY}
${Boost_CONTEXT_LIBRARY}
)
if (NOT "${VARIANT}" STREQUAL "coverage")
add_executable (http-bench
${BEAST_INCLUDES}
${EXTRAS_INCLUDES}
nodejs_parser.hpp
message_fuzz.hpp
../../extras/beast/unit_test/main.cpp
nodejs_parser.cpp
parser_bench.cpp
)
target_link_libraries(http-bench
Beast
${Boost_PROGRAM_OPTIONS_LIBRARY}
${Boost_FILESYSTEM_LIBRARY}
)
endif()

View File

@@ -27,9 +27,3 @@ unit-test http-tests :
verb.cpp
write.cpp
;
unit-test http-bench :
../../extras/beast/unit_test/main.cpp
nodejs_parser.cpp
parser_bench.cpp
;