[Glacier] Add a basic unit testing framework.
This commit is contained in:
parent
83b0d9ab61
commit
09d902dfb5
7 changed files with 43 additions and 0 deletions
8
lib/glacier/test/CMakeLists.txt
Normal file
8
lib/glacier/test/CMakeLists.txt
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
find_package(Catch2 3 REQUIRED)
|
||||
|
||||
add_subdirectory(container)
|
||||
|
||||
add_custom_target(build_test)
|
||||
add_dependencies(build_test
|
||||
glc_vec_test)
|
||||
|
||||
4
lib/glacier/test/container/CMakeLists.txt
Normal file
4
lib/glacier/test/container/CMakeLists.txt
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
add_executable(glc_vec_test vector.cpp)
|
||||
target_link_libraries(glc_vec_test glacier Catch2::Catch2WithMain)
|
||||
target_include_directories(glc_vec_test PRIVATE "../..")
|
||||
add_test(NAME glc_vec_test COMMAND $<TARGET_FILE:glc_vec_test>)
|
||||
10
lib/glacier/test/container/vector.cpp
Normal file
10
lib/glacier/test/container/vector.cpp
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
#include "container/vector.h"
|
||||
|
||||
#include <catch2/catch_test_macros.hpp>
|
||||
|
||||
using namespace glcr;
|
||||
|
||||
TEST_CASE("Build Vector", "[vector]") {
|
||||
Vector<uint64_t> v;
|
||||
REQUIRE(v.size() == 0);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue