summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Golubev <[email protected]>2016-12-18 16:44:15 +0300
committerSlávek Banko <[email protected]>2017-01-29 02:48:50 +0100
commitde48b4a218391da82d8bb725e5b8cb3038155065 (patch)
treef357f7aa83077186cfc3ba54b4d6883b668afd06
parentb3961a447f13b21afdf7a6ccb108b97d0dea4056 (diff)
downloadtdelibs-de48b4a218391da82d8bb725e5b8cb3038155065.tar.gz
tdelibs-de48b4a218391da82d8bb725e5b8cb3038155065.zip
fixup! tdecore/tdeconfig_compiler: add check/test executables
Signed-off-by: Alexander Golubev <[email protected]> (cherry picked from commit d556a8752c0862aa2d84a105dc8ac41b61ba7824)
-rw-r--r--tdecore/tdeconfig_compiler/tests/CMakeLists.txt82
1 files changed, 82 insertions, 0 deletions
diff --git a/tdecore/tdeconfig_compiler/tests/CMakeLists.txt b/tdecore/tdeconfig_compiler/tests/CMakeLists.txt
new file mode 100644
index 000000000..3034773b0
--- /dev/null
+++ b/tdecore/tdeconfig_compiler/tests/CMakeLists.txt
@@ -0,0 +1,82 @@
+#################################################
+#
+# (C) 2016 Alexander Golubev
+# fatzer2 (AT) gmail.com
+#
+# Improvements and feedback are welcome
+#
+# This file is released under GPL >= 2
+#
+#################################################
+
+include_directories(
+ ${TQT_INCLUDE_DIRS}
+ ${CMAKE_BINARY_DIR}
+ ${CMAKE_SOURCE_DIR}
+ ${CMAKE_CURRENT_BINARY_DIR}
+ ${CMAKE_CURRENT_SOURCE_DIR}
+ ${CMAKE_SOURCE_DIR}/dcop
+ ${CMAKE_BINARY_DIR}/tdecore
+ ${CMAKE_SOURCE_DIR}/tdecore
+)
+
+link_directories(
+ ${TQT_LIBRARY_DIRS}
+)
+
+add_definitions(
+ -DQT_NO_CAST_ASCII
+ -DSRCDIR="${CMAKE_CURRENT_SOURCE_DIR}"
+)
+
+set( TESTS test1 test2 test3 test4 test5 test6 test7 test8 test9 test_dpointer )
+
+# A couple of test got specific settings
+set( test8_KCFG test8a test8b )
+set( test_dpointer_MAIN test_dpointer_main.cpp )
+
+foreach( tst ${TESTS} )
+ unset( _sources )
+
+ # add main file (the second one is default
+ if( ${tst}_MAIN )
+ list( APPEND _sources ${${tst}_MAIN} )
+ else()
+ list( APPEND _sources "${tst}main.cpp" )
+ endif()
+
+ # set the default kcfg name
+ if( NOT ${tst}_KCFG )
+ set( ${tst}_KCFG ${tst} )
+ endif()
+
+ # kcfgc's here are not designed to be passed to kde3_add_kcfg_files() macro
+ # so we will process them manually
+ foreach( kcfg ${${tst}_KCFG})
+ add_custom_command(
+ OUTPUT ${kcfg}.cpp ${kcfg}.h
+ COMMAND "${CMAKE_BINARY_DIR}/tdecore/tdeconfig_compiler/tdeconfig_compiler"
+ ARGS "${CMAKE_CURRENT_SOURCE_DIR}/${kcfg}.kcfg"
+ "${CMAKE_CURRENT_SOURCE_DIR}/${kcfg}.kcfgc"
+ DEPENDS tdeconfig_compiler "${CMAKE_CURRENT_SOURCE_DIR}/${kcfg}.kcfg"
+ "${CMAKE_CURRENT_SOURCE_DIR}/${kcfg}.kcfgc"
+ )
+
+ add_test( NAME tdecore/tdeconfig_compiler/${kcfg}-cpp
+ COMMAND ${CMAKE_COMMAND} -E compare_files
+ "${CMAKE_CURRENT_BINARY_DIR}/${kcfg}.cpp"
+ "${CMAKE_CURRENT_SOURCE_DIR}/${kcfg}.cpp.ref" )
+
+ add_test( NAME tdecore/tdeconfig_compiler/${kcfg}-header
+ COMMAND ${CMAKE_COMMAND} -E compare_files
+ "${CMAKE_CURRENT_BINARY_DIR}/${kcfg}.h"
+ "${CMAKE_CURRENT_SOURCE_DIR}/${kcfg}.h.ref" )
+
+ list( APPEND _sources ${CMAKE_CURRENT_BINARY_DIR}/${kcfg}.cpp )
+ endforeach( )
+
+ tde_add_check_executable( ${tst} AUTOMOC
+ SOURCES ${_sources}
+ LINK tdecore-shared
+ )
+endforeach( tst ${TESTS} )