From b3408b77659d7f9fbce2ed15e85ef566e2733461 Mon Sep 17 00:00:00 2001 From: Alex Richardson Date: Thu, 8 May 2014 00:58:32 +0200 Subject: [PATCH] Use ecm_add_tests instead of custom macro This fixes running nmake test on Windows --- autotests/CMakeLists.txt | 31 ++++++++++++++----------------- 1 file changed, 14 insertions(+), 17 deletions(-) diff --git a/autotests/CMakeLists.txt b/autotests/CMakeLists.txt index aa4fb7b..6f4b3a5 100644 --- a/autotests/CMakeLists.txt +++ b/autotests/CMakeLists.txt @@ -12,23 +12,20 @@ find_package(Qt5 5.2.0 CONFIG REQUIRED Test Widgets) add_subdirectory(proxymodeltestsuite) -include(ECMMarkAsTest) - -macro(kitemmodels_proxymodel_tests) - foreach(_testname ${ARGN}) - add_executable(${_testname} ${_testname}.cpp ${proxyModelTestSources} ) - add_test(kitemmodels-${_testname} ${_testname}) - ecm_mark_as_test(${_testname}) - target_link_libraries(${_testname} KF5::ItemModels Qt5::Test Qt5::Widgets proxymodeltestsuite ) - endforeach(_testname) -endmacro() - - -kitemmodels_proxymodel_tests( - kdescendantsproxymodeltest - klinkitemselectionmodeltest - kselectionproxymodeltest - testmodelqueuedconnections +include(ECMAddTests) + +ecm_add_tests( + kdescendantsproxymodeltest.cpp + klinkitemselectionmodeltest.cpp + testmodelqueuedconnections.cpp + NAME_PREFIX "kitemmodels-" + LINK_LIBRARIES KF5::ItemModels Qt5::Test Qt5::Widgets proxymodeltestsuite +) + +#we need additional sources for this test, can't use it in ecm_add_tests +ecm_add_test(kselectionproxymodeltest.cpp ${proxyModelTestSources} + TEST_NAME "kitemmodels-kselectionproxymodeltest" + LINK_LIBRARIES KF5::ItemModels Qt5::Test Qt5::Widgets proxymodeltestsuite ) if (Qt5Script_FOUND)