Skip to content
This repository has been archived by the owner on Jan 2, 2025. It is now read-only.

Commit

Permalink
Simplify libndt installation
Browse files Browse the repository at this point in the history
- no subdirs for header and library, just use the libndt name

- for consistency with above, remove `measurement_kit` namespace
  • Loading branch information
bassosimone committed Jul 1, 2018
1 parent ca06ec3 commit 1cf4902
Show file tree
Hide file tree
Showing 9 changed files with 6 additions and 34 deletions.
17 changes: 3 additions & 14 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,7 @@ endif()
# Library

add_library(
ndt_objects
OBJECT
ndt
curlx.cpp
curlx.hpp
libndt.cpp
Expand All @@ -115,16 +114,6 @@ add_library(
strtonum.h
)
target_include_directories(
ndt_objects PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}
${CURL_INCLUDE_DIRS}
)

add_library(ndt $<TARGET_OBJECTS:ndt_objects>)
target_include_directories(
# Duplicate includes of `ndt_objects` because when building binaries we do
# not use `ndt_objects`, so includes are not transitively picked up.
# TODO(bassosimone): we can perhaps do this using a generator expression
# but so far I have failed to do this properly.
ndt PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}
${CURL_INCLUDE_DIRS}
)
Expand All @@ -135,13 +124,13 @@ install(
FILES
libndt.hpp
DESTINATION
include/measurement_kit/libndt
include
)
install(
TARGETS
ndt
DESTINATION
lib/measurement_kit/
lib
)
install(
TARGETS
Expand Down
8 changes: 3 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,17 @@
# Measurement Kit NDT engine
# NDT Client Engine

[![GitHub license](https://img.shields.io/github/license/measurement-kit/libndt.svg)](https://raw.githubusercontent.com/measurement-kit/libndt/master/LICENSE) [![Github Releases](https://img.shields.io/github/release/measurement-kit/libndt.svg)](https://github.com/measurement-kit/libndt/releases) [![Build Status](https://img.shields.io/travis/measurement-kit/libndt/master.svg)](https://travis-ci.org/measurement-kit/libndt) [![Coverage Status](https://img.shields.io/coveralls/measurement-kit/libndt/master.svg)](https://coveralls.io/github/measurement-kit/libndt?branch=master) [![Build status](https://img.shields.io/appveyor/ci/bassosimone/libndt/master.svg)](https://ci.appveyor.com/project/bassosimone/libndt/branch/master) [![Documentation](https://codedocs.xyz/measurement-kit/libndt.svg)](https://codedocs.xyz/measurement-kit/libndt/)

This repository compiles a NDT engine that is meant to be integrated into
the build of Measurement Kit.
`libndt` is a Network-Diagnostic-Tool (NDT) C++11 client engine.

## Synopsis

This example runs a NDT download-only nettest with a nearby server:

```C++
#include <measurement_kit/libndt/libndt.hpp>
#include <libndt.hpp>

int main() {
using namespace measurement_kit;
libndt::Client client;
client.run();
}
Expand Down
2 changes: 0 additions & 2 deletions curlx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ static size_t curl_callback(char *ptr, size_t size, size_t nmemb,

} // extern "C"

namespace measurement_kit {
namespace libndt {

#define EMIT_WARNING(client, statements) \
Expand Down Expand Up @@ -175,5 +174,4 @@ Curl::~Curl() noexcept {}
CURL *Curl::easy_init() noexcept { return ::curl_easy_init(); }

} // namespace libndt
} // namespace measurement_kit
#endif // HAVE_CURL
2 changes: 0 additions & 2 deletions curlx.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@

#include "libndt.hpp"

namespace measurement_kit {
namespace libndt {

class CurlDeleter {
Expand Down Expand Up @@ -64,6 +63,5 @@ class Curl {
};

} // namespace libndt
} // namespace measurement_kit
#endif // HAVE_CURL
#endif // MEASUREMENT_KIT_LIBNDT_CURLX_HPP
2 changes: 0 additions & 2 deletions curlx_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@

#include "catch.hpp"

using namespace measurement_kit;

// Curl::method_get_maybe_socks5() tests
// -------------------------------------

Expand Down
1 change: 0 additions & 1 deletion libndt-client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ static void usage() {
}

int main(int, char **argv) {
using namespace measurement_kit;
libndt::Settings settings;
settings.verbosity = libndt::verbosity_quiet;
settings.nettest_flags = 0; // you need to enable tests explicitly
Expand Down
2 changes: 0 additions & 2 deletions libndt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
#include "json.hpp"
#include "strtonum.h"

namespace measurement_kit {
namespace libndt {

// Private constants
Expand Down Expand Up @@ -1654,4 +1653,3 @@ int Client::getsockopt(int socket, int level, int name, void *value,
}

} // namespace libndt
} // namespace measurement_kit
4 changes: 0 additions & 4 deletions libndt.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,6 @@
#include <string>
#include <vector>

/// Contains measurement-kit code.
namespace measurement_kit {

/// Contains measurement-kit/libndt code.
namespace libndt {

Expand Down Expand Up @@ -406,5 +403,4 @@ enum class Err {
};

} // namespace libndt
} // namespace measurement_kit
#endif
2 changes: 0 additions & 2 deletions libndt_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,6 @@
// Speaking of coverage, if specific code is already tested by running the
// example client, we don't need to write also a test for it here.

using namespace measurement_kit;

// Client::run() tests
// -------------------

Expand Down

0 comments on commit 1cf4902

Please sign in to comment.