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

Commit

Permalink
Add JSON support to the mock tracer. (#48)
Browse files Browse the repository at this point in the history
* Filling out mocktracer API.

* Fill out StartSpanWithOptions function.

* Add Finish method.

* Fill out MockSpan methods.

* Fill out Log method.

* Add catch2.

* Convert string_view test cases to use catch2.

* Convert value_test to use catch2.

* Convert util_test to use catch2.

* Remove old testing macro.

* Remove custom assert.

* Reorganize.

* Separate out recorder.

* Add InMemoryRecorder.

* Add mocktracer_tracer_test.

* Add binary propagation functions.

* Add other Inject/Extract functions.

* Add code to do base64 conversions.

* Add other Inject/Extract functions.

* Add propagation tests.

* Rework mocktracer log functionality.

* Make mocktracer library follow BUILD_SHARED_LIBS/BUILD_STATIC_LIBS options.

* Make mocktracer build optional.

* Don't install catch2 header.

* Fix recursive macro warning.

* Fix warnings from base64.cpp.

* Log errors.

* Update clang-format script.

* Run clang-format.

* Allow MockTracer to be constructed without a recorder.

* Add mocktracer to bazel build.

* Add mocktracer to bazel build.

* Work around gcc-4.9 limitation.

* Fix installation path.

* Set up functions for json conversion.

* Implement ToJson function.

* Add json deserialization.

* Add test coverage for serialization/deserialization code.

* Add additional serialization/deserialization coverage.

* Run clang-format.

* Add JsonRecorder.

* Add JsonRecorder.

* Comment mocktracer.

* Update exception specification.

* Use inline namespace with vendored libraries.

* Correct typo.
  • Loading branch information
rnburn committed Jan 22, 2018
1 parent 29dc428 commit 359bafe
Show file tree
Hide file tree
Showing 20 changed files with 14,533 additions and 6 deletions.
3 changes: 3 additions & 0 deletions 3rd_party/include/opentracing/expected/expected.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#include <stdexcept>
#include <type_traits>
#include <utility>
#include <opentracing/version.h>

#define expected_lite_VERSION "0.0.0"

Expand All @@ -45,6 +46,7 @@
typename = typename std::enable_if< (__VA_ARGS__), opentracing::expected_detail::enabler >::type

namespace opentracing {
BEGIN_OPENTRACING_ABI_NAMESPACE

template< typename T, typename E >
class expected;
Expand Down Expand Up @@ -1186,6 +1188,7 @@ constexpr auto make_expected_from_error( E e ) -> expected<T, typename std::deca
return expected<T, typename std::decay<E>::type>( make_unexpected( e ) );
}

END_OPENTRACING_ABI_NAMESPACE
} // namespace opentracing

namespace std {
Expand Down
3 changes: 3 additions & 0 deletions 3rd_party/include/opentracing/variant/recursive_wrapper.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,10 @@

#include <cassert>
#include <utility>
#include <opentracing/version.h>

namespace opentracing {
BEGIN_OPENTRACING_ABI_NAMESPACE
namespace util {

template <typename T>
Expand Down Expand Up @@ -117,6 +119,7 @@ inline void swap(recursive_wrapper<T>& lhs, recursive_wrapper<T>& rhs) noexcept
lhs.swap(rhs);
}
} // namespace util
END_OPENTRACING_ABI_NAMESPACE
} // namespace opentracing

#endif // OPENTRACING_UTIL_RECURSIVE_WRAPPER_HPP
3 changes: 3 additions & 0 deletions 3rd_party/include/opentracing/variant/variant.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#include <type_traits>
#include <typeinfo>
#include <utility>
#include <opentracing/version.h>

#include "recursive_wrapper.hpp"

Expand Down Expand Up @@ -51,6 +52,7 @@
#define VARIANT_VERSION (VARIANT_MAJOR_VERSION * 100000) + (VARIANT_MINOR_VERSION * 100) + (VARIANT_PATCH_VERSION)

namespace opentracing {
BEGIN_OPENTRACING_ABI_NAMESPACE
namespace util {

// XXX This should derive from std::logic_error instead of std::runtime_error.
Expand Down Expand Up @@ -896,6 +898,7 @@ ResultType const& get(T const& var)
return var.template get<ResultType>();
}
} // namespace util
END_OPENTRACING_ABI_NAMESPACE
} // namespace opentracing

#endif // OPENTRACING_UTIL_VARIANT_HPP
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -92,15 +92,15 @@ if (BUILD_SHARED_LIBS)
set_target_properties(opentracing PROPERTIES
CXX_CLANG_TIDY "${DO_CLANG_TIDY}")
endif()
endif(BUILD_SHARED_LIBS)
endif()

if (BUILD_STATIC_LIBS)
add_library(opentracing-static STATIC ${SRCS})
set_target_properties(opentracing-static PROPERTIES OUTPUT_NAME opentracing)
target_include_directories(opentracing-static INTERFACE "$<INSTALL_INTERFACE:include/>")
install(TARGETS opentracing-static EXPORT OpenTracingTargets
ARCHIVE DESTINATION lib)
endif(BUILD_STATIC_LIBS)
endif()


install(DIRECTORY 3rd_party/include/opentracing/expected DESTINATION include/opentracing
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -195,5 +195,5 @@ backwards compatibility will become more of a priority.
This library requires C++11 or later. But if you're interested in a C or C++98
API contact us on [gitter](https://gitter.im/opentracing/opentracing-cpp?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge).
We're open to supporting additional APIs in a separate repository if there's
We're open to supporting additional APIs in a separate repository if there are
people willing to maintain it.
999 changes: 999 additions & 0 deletions mocktracer/3rd_party/nlohmann/LICENSE.MIT

Large diffs are not rendered by default.

Loading

0 comments on commit 359bafe

Please sign in to comment.