Skip to content

Commit

Permalink
Fix test options
Browse files Browse the repository at this point in the history
  • Loading branch information
foonathan committed Aug 23, 2018
1 parent 1ae71cb commit 838ace6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,7 @@ endif()
# other subdirectories
# only add if not inside add_subdirectory()
option(TYPE_SAFE_BUILD_TEST_EXAMPLE "build test and example" OFF)
option(BUILD_TESTING "build test and example" OFF) # The ctest variable for building tests
if(${TYPE_SAFE_BUILD_TEST_EXAMPLE} OR ((CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR) AND ${BUILD_TESTING}))
if(${TYPE_SAFE_BUILD_TEST_EXAMPLE} OR (CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR))
enable_testing()
add_subdirectory(example/)
add_subdirectory(test/)
Expand Down
2 changes: 1 addition & 1 deletion example/types.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ int main()
// ts::double_t d2; // error: no default constructor
ts::double_t d3(0.f); // okay: float -> double is allowed

std::cout << "floating point value: " << f1 << ' ' << d1 << '\n';
std::cout << "floating point value: " << f1 << ' ' << d1 << ' ' << d3 << '\n';

// f1++; // error: no in/decrement for floats
// f1 == 0.f; // error: no equality comparison for floats
Expand Down

0 comments on commit 838ace6

Please sign in to comment.