Skip to content

Commit 1863b03

Browse files
committed
feat: optional unit testing
1 parent 298e43a commit 1863b03

2 files changed

Lines changed: 12 additions & 0 deletions

File tree

CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,11 @@ add_subdirectory(processors)
2323
add_subdirectory(commands)
2424
add_subdirectory(kb)
2525

26+
if(REDASM_SAMPLES)
27+
enable_testing()
28+
add_subdirectory(tests)
29+
endif()
30+
2631
macro(redasm_stage target dest)
2732
add_custom_target(stage_${target} ALL
2833
COMMAND ${CMAKE_COMMAND} -E make_directory "${dest}"

Setup.cmake

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ cmake_minimum_required(VERSION 3.25)
22

33
find_package(Git REQUIRED)
44

5+
option(REDASM_FETCH_TESTS "Fetch tests and samples repositories" OFF)
6+
57
if(NOT GIT_FOUND)
68
message(FATAL_ERROR "Git is required to clone repositories. Please install Git and try again.")
79
endif()
@@ -59,6 +61,11 @@ set(REPOS
5961
analyzers
6062
kb
6163
)
64+
65+
if(REDASM_FETCH_TESTS)
66+
list(APPEND REPOS tests)
67+
list(APPEND REPOS samples)
68+
endif()
6269

6370
foreach(repo ${REPOS})
6471
set(version ${REPO_${repo}})

0 commit comments

Comments
 (0)