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

Commit

Permalink
Allow user to disable testing. (#21)
Browse files Browse the repository at this point in the history
* Allow user to disable testing.

* Fix typo.

* Fix constructor for macOS.

* More fixes.

* Use conventional option for building tests.
  • Loading branch information
isaachier authored and rnburn committed Oct 2, 2017
1 parent 5d24fd8 commit 57a5239
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 12 deletions.
27 changes: 16 additions & 11 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
cmake_minimum_required(VERSION 3.1)
enable_testing()

project(opentracing-cpp)

Expand All @@ -10,7 +9,7 @@ set(OPENTRACING_ABI_VERSION "1")
set(OPENTRACING_VERSION_MAJOR "1")
set(OPENTRACING_VERSION_MINOR "0")
set(OPENTRACING_VERSION_PATCH "0")
set(OPENTRACING_VERSION_STRING
set(OPENTRACING_VERSION_STRING
"${OPENTRACING_VERSION_MAJOR}.${OPENTRACING_VERSION_MINOR}.${OPENTRACING_VERSION_PATCH}")

# ==============================================================================
Expand All @@ -31,7 +30,7 @@ include(CPack)

configure_file(version.h.in include/opentracing/version.h)
include_directories(${CMAKE_CURRENT_BINARY_DIR}/include)
install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/include/opentracing
install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/include/opentracing
DESTINATION include)

# ==============================================================================
Expand All @@ -53,13 +52,16 @@ endif()
# ==============================================================================
# Set up linter

find_program(CLANG_TIDY_EXE NAMES "clang-tidy"
DOC "Path to clang-tidy executable")
if(NOT CLANG_TIDY_EXE)
message(STATUS "clang-tidy not found.")
else()
message(STATUS "clang-tidy found: ${CLANG_TIDY_EXE}")
set(DO_CLANG_TIDY "${CLANG_TIDY_EXE}" "-checks=*,-clang-analyzer-alpha.*")
option(ENABLE_LINTING "Run clang-tidy on source files" ON)
if(ENABLE_LINTING)
find_program(CLANG_TIDY_EXE NAMES "clang-tidy"
DOC "Path to clang-tidy executable")
if(NOT CLANG_TIDY_EXE)
message(STATUS "clang-tidy not found.")
else()
message(STATUS "clang-tidy found: ${CLANG_TIDY_EXE}")
set(DO_CLANG_TIDY "${CLANG_TIDY_EXE}" "-checks=*,-clang-analyzer-alpha.*")
endif()
endif()

# ==============================================================================
Expand Down Expand Up @@ -117,4 +119,7 @@ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/OpenTracingConfig.cmake
# ==============================================================================
# Testing

add_subdirectory(test)
include(CTest)
if(BUILD_TESTING)
add_subdirectory(test)
endif()
2 changes: 1 addition & 1 deletion include/opentracing/propagation.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class SpanContext;
enum class SpanReferenceType {
// ChildOfRef refers to a parent Span that caused *and* somehow depends
// upon the new child Span. Often (but not always), the parent Span cannot
// finish unitl the child Span does.
// finish until the child Span does.
//
// An timing diagram for a ChildOfRef that's blocked on the new Span:
//
Expand Down
7 changes: 7 additions & 0 deletions src/propagation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@ BEGIN_OPENTRACING_ABI_NAMESPACE
namespace {
class PropagationErrorCategory : public std::error_category {
public:
// Needed to fix bug in macOS build
// (https://travis-ci.org/isaachier/hunter/jobs/281868518).
// See https://stackoverflow.com/a/7411708/1930331 for justification.
PropagationErrorCategory()
{
}

const char* name() const noexcept override {
return "OpenTracingPropagationError";
}
Expand Down

0 comments on commit 57a5239

Please sign in to comment.