mirror of
https://github.com/arabine/open-story-teller.git
synced 2025-12-06 17:09:06 +01:00
75 lines
2.5 KiB
CMake
75 lines
2.5 KiB
CMake
cmake_minimum_required(VERSION 3.11)
|
|
|
|
project(core_tests LANGUAGES CXX C)
|
|
|
|
set(CMAKE_CXX_STANDARD 17)
|
|
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
|
|
|
# ============================================================================
|
|
# Téléchargement et configuration de Catch2 v3
|
|
# ============================================================================
|
|
include(FetchContent)
|
|
|
|
FetchContent_Declare(
|
|
Catch2
|
|
GIT_REPOSITORY https://github.com/catchorg/Catch2.git
|
|
GIT_TAG v3.7.1 # Dernière version stable de Catch2 v3
|
|
GIT_SHALLOW TRUE
|
|
)
|
|
|
|
FetchContent_MakeAvailable(Catch2)
|
|
|
|
# Ajouter le module Catch2 pour la découverte automatique des tests
|
|
list(APPEND CMAKE_MODULE_PATH ${catch2_SOURCE_DIR}/extras)
|
|
|
|
# ============================================================================
|
|
# Exécutable de tests
|
|
# ============================================================================
|
|
add_executable(${PROJECT_NAME}
|
|
test_parser.cpp
|
|
test_vm.cpp
|
|
test_ast.cpp
|
|
test_print_node.cpp
|
|
test_branch.cpp
|
|
test_loops.cpp
|
|
|
|
../story-manager/src/nodes/base_node.cpp
|
|
../story-manager/src/nodes/branch_node.cpp
|
|
../story-manager/src/nodes/print_node.cpp
|
|
../story-manager/src/nodes/variable_node.cpp
|
|
../story-manager/src/nodes/connection.cpp
|
|
../story-manager/src/nodes/wait_event_node.cpp
|
|
../story-manager/src/nodes/wait_delay_node.cpp
|
|
../story-manager/src/nodes/play_media_node.cpp
|
|
../story-manager/src/nodes/send_signal_node.cpp
|
|
../story-manager/src/nodes/for_loop_node.cpp
|
|
../story-manager/src/nodes/while_loop_node.cpp
|
|
../story-manager/src/nodes/break_node.cpp
|
|
../story-manager/src/nodes/continue_node.cpp
|
|
|
|
|
|
../chip32/chip32_assembler.cpp
|
|
../chip32/chip32_vm.c
|
|
../chip32/chip32_binary_format.c
|
|
)
|
|
|
|
target_include_directories(${PROJECT_NAME} PRIVATE
|
|
../chip32
|
|
../story-manager/src
|
|
../story-manager/src/nodes
|
|
../story-manager/src/compiler
|
|
../story-manager/interfaces
|
|
../../shared
|
|
)
|
|
|
|
# ============================================================================
|
|
# Linkage avec Catch2
|
|
# ============================================================================
|
|
target_link_libraries(${PROJECT_NAME} PRIVATE Catch2::Catch2WithMain)
|
|
|
|
# ============================================================================
|
|
# Découverte automatique des tests (optionnel mais recommandé)
|
|
# ============================================================================
|
|
include(CTest)
|
|
include(Catch)
|
|
catch_discover_tests(${PROJECT_NAME}) |