Skip to content

Commit e748405

Browse files
committed
Merge pull request #80 from evoskuil/master
Add endpoint parser tests.
2 parents 9518073 + dc10c1b commit e748405

23 files changed

Lines changed: 154 additions & 37 deletions

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ script:
7575
# Download and build libbitcoin-server and all dependencies.
7676
- if [[ $OSX && $CLANG && $STATIC ]]; then ./install.sh --without-consensus --with-secp256k1 --without-openssl --enable-testnet --disable-shared --build-boost --prefix=$TRAVIS_BUILD_DIR/my-prefix; fi
7777
- if [[ $LINUX && $CLANG && $STATIC ]]; then ./install.sh --with-secp256k1 --without-openssl --disable-shared --build-boost --prefix=$TRAVIS_BUILD_DIR/my-prefix CFLAGS='-Os' LDLIBS='-lstdc++' CXXFLAGS='-Os -stdlib=libstdc++'; fi
78-
- if [[ $LINUX && $GCC && $STATIC ]]; then ./install.sh --disable-ndebug --disable-shared --build-boost --build-dir=my-build --prefix=$TRAVIS_BUILD_DIR/my-prefix --with-bash-completiondir CFLAGS='-Os -s -static' CXXFLAGS='-Os -s -static'; fi
78+
- if [[ $LINUX && $GCC && $STATIC ]]; then ./install.sh --build-boost --disable-shared --build-dir=my-build --prefix=$TRAVIS_BUILD_DIR/my-prefix --with-bash-completiondir CFLAGS='-O0 -g -static --coverage' CXXFLAGS='-O0 -g -static --coverage'; fi
7979
- if [[ $OSX && $CLANG && $DYNAMIC ]]; then ./install.sh --with-secp256k1 --without-openssl --with-bash-completiondir; fi
8080
- if [[ $LINUX && $CLANG && $DYNAMIC ]]; then sudo CXX=$CXX CC=$CC ./install.sh --disable-ndebug --disable-static CFLAGS='-Os' LDLIBS='-lstdc++' CXXFLAGS='-Os -stdlib=libstdc++'; fi
8181
- if [[ $LINUX && $GCC && $DYNAMIC ]]; then sudo CXX=$CXX CC=$CC ./install.sh --without-consensus --disable-static --build-boost --with-bash-completiondir CFLAGS='-Os -s' CXXFLAGS='-Os -s'; fi

Makefile.am

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,10 @@ if WITH_TESTS
5757
TESTS = libbitcoin_server_test_runner.sh
5858

5959
check_PROGRAMS = test/libbitcoin_server_test
60-
test_libbitcoin_server_test_CPPFLAGS = -I${srcdir}/include ${bitcoin_node_CPPFLAGS}
61-
test_libbitcoin_server_test_LDADD = ${bitcoin_node_LIBS} ${boost_unit_test_framework_LIBS}
60+
test_libbitcoin_server_test_CPPFLAGS = -I${srcdir}/include ${bitcoin_node_CPPFLAGS} ${sodium_CPPFLAGS} ${czmq___CPPFLAGS}
61+
test_libbitcoin_server_test_LDADD = src/libbitcoin-server.la ${boost_unit_test_framework_LIBS} ${bitcoin_node_LIBS} ${sodium_LIBS} ${czmq___LIBS}
6262
test_libbitcoin_server_test_SOURCES = \
63+
test/endpoint.cpp \
6364
test/main.cpp \
6465
test/server.cpp \
6566
test/stress.sh

builds/msvc/vs2013/libbitcoin-server-test/libbitcoin-server-test.vcxproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@
110110
</ProjectReference>
111111
</ItemGroup>
112112
<ItemGroup>
113+
<ClCompile Include="..\..\..\..\test\endpoint.cpp" />
113114
<ClCompile Include="..\..\..\..\test\main.cpp" />
114115
<ClCompile Include="..\..\..\..\test\server.cpp" />
115116
</ItemGroup>

builds/msvc/vs2013/libbitcoin-server-test/libbitcoin-server-test.vcxproj.filters

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,8 @@
1515
<ClCompile Include="..\..\..\..\test\main.cpp">
1616
<Filter>src</Filter>
1717
</ClCompile>
18+
<ClCompile Include="..\..\..\..\test\endpoint.cpp">
19+
<Filter>src</Filter>
20+
</ClCompile>
1821
</ItemGroup>
1922
</Project>

include/bitcoin/server/config/config.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
#include <vector>
2626
#include <boost/filesystem.hpp>
2727
#include <boost/program_options.hpp>
28+
#include <bitcoin/server/define.hpp>
2829

2930
namespace libbitcoin {
3031
namespace server {
@@ -38,7 +39,7 @@ class config_type;
3839
* Lod configurable vlaues from environment variables, settings file, and
3940
* command line positional and non-positional options.
4041
*/
41-
bool load_config(config_type& metadata, std::string& message, int argc,
42+
bool BCS_API load_config(config_type& metadata, std::string& message, int argc,
4243
const char* argv[]);
4344

4445
} // namespace server

include/bitcoin/server/config/endpoint.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,13 @@
2525
#include <string>
2626
#include <boost/filesystem.hpp>
2727
#include <boost/program_options.hpp>
28+
#include <bitcoin/server/define.hpp>
2829
#include <bitcoin/bitcoin.hpp>
2930

3031
namespace libbitcoin {
3132
namespace server {
3233

33-
class endpoint_type
34+
class BCS_API endpoint_type
3435
{
3536
public:
3637
endpoint_type();

include/bitcoin/server/config/settings.hpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
#include <boost/filesystem.hpp>
2727
#include <boost/program_options.hpp>
2828
#include <bitcoin/server/config/endpoint.hpp>
29+
#include <bitcoin/server/define.hpp>
2930

3031
// Not localizable.
3132
#define BS_HELP_VARIABLE "help"
@@ -41,7 +42,7 @@
4142
namespace libbitcoin {
4243
namespace server {
4344

44-
struct settings_type
45+
struct BCS_API settings_type
4546
{
4647
// options
4748
bool help;
@@ -74,7 +75,7 @@ struct settings_type
7475
std::vector<endpoint_type> peers;
7576
};
7677

77-
class config_type
78+
class BCS_API config_type
7879
{
7980
public:
8081
const boost::program_options::options_description load_settings();

include/bitcoin/server/dispatch.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
#define LIBBITCOIN_SERVER_DISPATCH_HPP
2222

2323
#include <iostream>
24+
#include <bitcoin/server/define.hpp>
2425

2526
namespace libbitcoin {
2627
namespace server {
@@ -38,7 +39,7 @@ enum console_result : int
3839
/**
3940
* Dispatch from the command line.
4041
*/
41-
console_result dispatch(int argc, const char* argv[], std::istream&,
42+
console_result BCS_API dispatch(int argc, const char* argv[], std::istream&,
4243
std::ostream& output, std::ostream& error);
4344

4445
} // namespace server

include/bitcoin/server/message.hpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,12 @@
2222

2323
#include <czmq++/czmqpp.hpp>
2424
#include <bitcoin/bitcoin.hpp>
25+
#include <bitcoin/server/define.hpp>
2526

2627
namespace libbitcoin {
2728
namespace server {
2829

29-
class incoming_message
30+
class BCS_API incoming_message
3031
{
3132
public:
3233
bool recv(czmqpp::socket& socket);
@@ -42,7 +43,7 @@ class incoming_message
4243
bc::data_chunk data_;
4344
};
4445

45-
class outgoing_message
46+
class BCS_API outgoing_message
4647
{
4748
public:
4849
// Empty dest = unspecified destination.

include/bitcoin/server/publisher.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,13 @@
2323
#include <czmq++/czmqpp.hpp>
2424
#include <bitcoin/bitcoin.hpp>
2525
#include <bitcoin/server/config/settings.hpp>
26+
#include <bitcoin/server/define.hpp>
2627
#include <bitcoin/server/server_node.hpp>
2728

2829
namespace libbitcoin {
2930
namespace server {
3031

31-
class publisher
32+
class BCS_API publisher
3233
{
3334
public:
3435
publisher(server_node& node);

0 commit comments

Comments
 (0)