1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-05-13 22:06:58 +02:00

vcmi: fix building tests without scripts

This commit is contained in:
Konstantin 2023-03-01 13:03:07 +03:00 committed by Konstantin P
parent 276bd5eebf
commit 015f55cd82

View File

@ -30,22 +30,6 @@ set(test_SRCS
entity/CHeroTest.cpp entity/CHeroTest.cpp
entity/CSkillTest.cpp entity/CSkillTest.cpp
erm/ERM_BM.cpp
erm/ERM_BU.cpp
erm/ERM_FU.cpp
erm/ERM_GM_T.cpp
erm/ERM_MA.cpp
erm/ERM_MC.cpp
erm/ERM_MF.cpp
erm/ERM_TM_T.cpp
erm/ERM_VR.cpp
erm/ERM_UN.cpp
erm/ERMPersistenceTest.cpp
erm/ExamplesTest.cpp
erm/interpretter/ERM_VR.cpp
erm/interpretter/ERM_UN.cpp
erm/interpretter/ErmRunner.cpp
events/ApplyDamageTest.cpp events/ApplyDamageTest.cpp
events/EventBusTest.cpp events/EventBusTest.cpp
@ -58,12 +42,6 @@ set(test_SRCS
netpacks/EntitiesChangedTest.cpp netpacks/EntitiesChangedTest.cpp
netpacks/NetPackFixture.cpp netpacks/NetPackFixture.cpp
scripting/LuaSandboxTest.cpp
scripting/LuaSpellEffectTest.cpp
scripting/LuaSpellEffectAPITest.cpp
scripting/PoolTest.cpp
scripting/ScriptFixture.cpp
spells/AbilityCasterTest.cpp spells/AbilityCasterTest.cpp
spells/CSpellTest.cpp spells/CSpellTest.cpp
spells/TargetConditionTest.cpp spells/TargetConditionTest.cpp
@ -105,9 +83,6 @@ set(test_HEADERS
CVcmiTestConfig.h CVcmiTestConfig.h
JsonComparer.h JsonComparer.h
scripting/ScriptFixture.h
erm/interpretter/ErmRunner.h
map/MapComparer.h map/MapComparer.h
netpacks/NetPackFixture.h netpacks/NetPackFixture.h
@ -126,6 +101,44 @@ set(test_HEADERS
) )
if(ENABLE_LUA)
list(APPEND test_SRCS
scripting/LuaSandboxTest.cpp
scripting/LuaSpellEffectTest.cpp
scripting/LuaSpellEffectAPITest.cpp
scripting/PoolTest.cpp
scripting/ScriptFixture.cpp
)
list(APPEND test_HEADERS
scripting/ScriptFixture.h
)
endif()
if(ENABLE_ERM)
list(APPEND test_SRCS
erm/ERM_BM.cpp
erm/ERM_BU.cpp
erm/ERM_FU.cpp
erm/ERM_GM_T.cpp
erm/ERM_MA.cpp
erm/ERM_MC.cpp
erm/ERM_MF.cpp
erm/ERM_TM_T.cpp
erm/ERM_VR.cpp
erm/ERM_UN.cpp
erm/ERMPersistenceTest.cpp
erm/ExamplesTest.cpp
erm/interpretter/ERM_VR.cpp
erm/interpretter/ERM_UN.cpp
erm/interpretter/ErmRunner.cpp
)
list(APPEND test_HEADERS
erm/interpretter/ErmRunner.h
)
endif()
assign_source_group(${test_SRCS} ${test_HEADERS}) assign_source_group(${test_SRCS} ${test_HEADERS})
set(mock_HEADERS set(mock_HEADERS
@ -170,16 +183,10 @@ target_include_directories(vcmitest
PRIVATE ${GMockSrc}/include PRIVATE ${GMockSrc}/include
) )
if(FALSE AND NOT ${CMAKE_VERSION} VERSION_LESS "3.10.0") # Running tests one by one using ctest not recommended due to vcmi having
# Running tests one by one using ctest not recommended due to vcmi having # slow global initialization.
# slow global initialization. gtest_discover_tests(vcmitest
gtest_discover_tests(vcmitest
WORKING_DIRECTORY "${CMAKE_BINARY_DIR}/bin/") WORKING_DIRECTORY "${CMAKE_BINARY_DIR}/bin/")
else()
add_test(NAME tests
COMMAND vcmitest
WORKING_DIRECTORY "${CMAKE_BINARY_DIR}/bin/")
endif()
vcmi_set_output_dir(vcmitest "") vcmi_set_output_dir(vcmitest "")