[kdelibs/frameworks] staging/libkarchive/autotests: Port away from kde4_add_unit_test/kde4_add_executable

David Faure faure at kde.org
Sun Dec 11 10:01:20 UTC 2011


Git commit 9b5640a141581487acebe40a3c33b1d17f334388 by David Faure.
Committed on 11/12/2011 at 11:02.
Pushed by dfaure into branch 'frameworks'.

Port away from kde4_add_unit_test/kde4_add_executable

One issue though, how to port NOGUI?
CCMAIL: kde-buildsystem at kde.org

M  +9    -5    staging/libkarchive/autotests/CMakeLists.txt

http://commits.kde.org/kdelibs/9b5640a141581487acebe40a3c33b1d17f334388

diff --git a/staging/libkarchive/autotests/CMakeLists.txt b/staging/libkarchive/autotests/CMakeLists.txt
index fa4a8e9..247f72c 100644
--- a/staging/libkarchive/autotests/CMakeLists.txt
+++ b/staging/libkarchive/autotests/CMakeLists.txt
@@ -1,3 +1,4 @@
+enable_testing()
 set( EXECUTABLE_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR} )
 
 include_directories(
@@ -10,16 +11,17 @@ include_directories(
 
 MACRO(KARCHIVE_UNIT_TESTS)
        FOREACH(_testname ${ARGN})
-               kde4_add_unit_test(${_testname} TESTNAME "karchive-${_testname}" NOGUI ${_testname}.cpp)
+               add_executable(${_testname} ${_testname}.cpp) # TODO NOGUI
+               add_test(karchive-${_testname} ${_testname})
                target_link_libraries(${_testname} karchive ${QT_QTTEST_LIBRARY} ${QT_QTNETWORK_LIBRARY} ${QT_QTCORE_LIBRARY} kcoreaddons kdecore inqt5) #kdecore for KMimeType, TODO REMOVE
                if(WINCE)
                 target_link_libraries(${_testname} ${WCECOMPAT_LIBRARIES})
                endif(WINCE)
        ENDFOREACH(_testname)
 ENDMACRO(KARCHIVE_UNIT_TESTS)
-MACRO(KARCHIVE_EXECUTABLE_TESTS)
+MACRO(KARCHIVE_EXECUTABLE_TESTS) # TODO move to ../examples
        FOREACH(_testname ${ARGN})
-               kde4_add_executable(${_testname} NOGUI TEST ${_testname}.cpp)
+               add_executable(${_testname} ${_testname}.cpp) # TODO NOGUI
                target_link_libraries(${_testname} karchive ${QT_QTTEST_LIBRARY} ${QT_QTCORE_LIBRARY} )
                if(WINCE)
                 target_link_libraries(${_testname} ${WCECOMPAT_LIBRARIES})
@@ -38,7 +40,8 @@ KARCHIVE_EXECUTABLE_TESTS(
 
 ########### klimitediodevicetest ###############
 
-kde4_add_unit_test(klimitediodevicetest TESTNAME karchive-klimitediodevicetest klimitediodevicetest.cpp ../src/klimitediodevice.cpp)
+add_executable(klimitediodevicetest klimitediodevicetest.cpp ../src/klimitediodevice.cpp)
+add_test(karchive-klimitediodevicetest klimitediodevicetest)
 target_link_libraries(klimitediodevicetest ${KDE4_KDECORE_LIBS} ${QT_QTTEST_LIBRARY})
 
 ########### kfiltertest ###############
@@ -47,6 +50,7 @@ target_link_libraries(klimitediodevicetest ${KDE4_KDECORE_LIBS} ${QT_QTTEST_LIBR
 # (only par of kio_http and kmultipart)
 set(kfiltertest_SRCS kfiltertest.cpp ${CMAKE_SOURCE_DIR}/kio/httpfilter/httpfilter.cc)
 include_directories( ${CMAKE_SOURCE_DIR}/kio/httpfilter )
-kde4_add_unit_test(kfiltertest TESTNAME karchive-kfiltertest ${kfiltertest_SRCS})
+add_executable(kfiltertest ${kfiltertest_SRCS})
+add_test(karchive-kfiltertest kfiltertest)
 target_link_libraries(kfiltertest ${KDE4_KDECORE_LIBS} ${QT_QTTEST_LIBRARY} karchive kcoreaddons)
 target_link_libraries(kfiltertest ${ZLIB_LIBRARIES})


More information about the Kde-buildsystem mailing list