Add test scaffolding
This commit is contained in:
@@ -8,3 +8,11 @@ set(CMAKE_CXX_STANDARD 20)
|
|||||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||||
|
|
||||||
add_library(conflict_set ConflictSet.cpp ConflictSet.h)
|
add_library(conflict_set ConflictSet.cpp ConflictSet.h)
|
||||||
|
|
||||||
|
add_executable(conflict_set_test ConflictSet.cpp ConflictSet.h)
|
||||||
|
target_compile_definitions(conflict_set_test PRIVATE ENABLE_TESTS)
|
||||||
|
# keep asserts for test
|
||||||
|
target_compile_options(conflict_set_test PRIVATE -UNDEBUG)
|
||||||
|
|
||||||
|
include(CTest)
|
||||||
|
add_test(NAME conflict_set_test COMMAND conflict_set_test)
|
@@ -149,3 +149,7 @@ ConflictSet &ConflictSet::operator=(ConflictSet &&other) noexcept {
|
|||||||
impl = std::exchange(other.impl, nullptr);
|
impl = std::exchange(other.impl, nullptr);
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef ENABLE_TESTS
|
||||||
|
int main(void) { ConflictSet cs{0}; }
|
||||||
|
#endif
|
Reference in New Issue
Block a user