Skip to content

Commit

Permalink
add unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
chenhao-ye committed Apr 9, 2024
1 parent b95fa96 commit 13635d1
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ cmake_minimum_required(VERSION 3.9)
project(gcache)
set(CMAKE_CXX_STANDARD 20)

enable_testing()

set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -Wall -Werror -msse4.2")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -Wall -Werror -msse4.2")
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -Wall -Werror -msse4.2")
Expand All @@ -22,6 +24,7 @@ set(SOURCE_FILES
include/gcache/node.h
include/gcache/table.h
include/gcache/lru_cache.h
include/gcache/stat.h
include/gcache/ghost_cache.h
include/gcache/shared_cache.h)

Expand All @@ -34,3 +37,8 @@ add_executable(gcache_bench_ghost ${SOURCE_FILES} benchmarks/bench_ghost.cpp)
if(SAMPLE_SHIFT)
target_compile_definitions(gcache_bench_ghost PRIVATE SAMPLE_SHIFT=${SAMPLE_SHIFT})
endif()

add_test(NAME test_lru COMMAND gcache_test_lru)
add_test(NAME test_shared COMMAND gcache_test_shared)
add_test(NAME test_ghost COMMAND gcache_test_ghost)
add_test(NAME bench_ghost COMMAND gcache_bench_ghost)

0 comments on commit 13635d1

Please sign in to comment.