[Kst] branches/work/kst/portto4/kst

Peter Kümmel syntheticpp at gmx.net
Wed Jan 12 21:01:04 CET 2011


SVN commit 1214065 by kuemmel:

add test for GeneratedVector

 M  +0 -1      cmake/CMakeLists.txt  
 M  +8 -0      cmake/modules/KstMacros.cmake  
 M  +0 -1      cmake/src/datasources/CMakeLists.txt  
 M  +0 -1      cmake/src/plugins/CMakeLists.txt  
 M  +20 -2     cmake/tests/CMakeLists.txt  
 AM            tests/ksttest.h   [License: GPL (v2+)]
 AM            tests/testgeneratedvector.cpp   [License: GPL (v2+)]
 AM            tests/testgeneratedvector.h   [License: GPL (v2+)]


--- branches/work/kst/portto4/kst/cmake/CMakeLists.txt #1214064:1214065
@@ -91,7 +91,6 @@
 endif()
 	
 
-
 set(CMAKE_RUNTIME_OUTPUT_DIRECTORY  ${CMAKE_BINARY_DIR}/bin)
 set(CMAKE_LIBRARY_OUTPUT_DIRECTORY  ${CMAKE_BINARY_DIR}/lib) 
 set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY  ${CMAKE_BINARY_DIR}/lib) 
--- branches/work/kst/portto4/kst/cmake/modules/KstMacros.cmake #1214064:1214065
@@ -212,3 +212,11 @@
 	kst_add_info_files(${group} ${_filelist})
 endmacro()
 
+
+macro(kst_flat_source_group)
+	source_group("Source Files" Files)
+	source_group("Header Files" Files)
+	source_group("CMakeLists" FILES CMakeLists.txt)
+endmacro()
+
+
--- branches/work/kst/portto4/kst/cmake/src/datasources/CMakeLists.txt #1214064:1214065
@@ -48,6 +48,5 @@
   #kst_link(${DMC_LIBRARIES})
 endif()
 
-message(STATUS)
 
 
--- branches/work/kst/portto4/kst/cmake/src/plugins/CMakeLists.txt #1214064:1214065
@@ -64,7 +64,6 @@
 endif()
 
 
-message(STATUS)
 
 
 
--- branches/work/kst/portto4/kst/cmake/tests/CMakeLists.txt #1214064:1214065
@@ -2,6 +2,8 @@
 
 file(GLOB test_headers ${kst_dir}/tests/*.h)
 
+list(REMOVE_ITEM test_headers ${kst_dir}/tests/ksttest.h)
+
 kst_include_directories(kstcore kstmath)
 
 add_definitions(-DKST_USE_QTEST_MAIN)
@@ -9,16 +11,32 @@
 foreach(header ${test_headers})
 	get_filename_component(filename ${header} NAME_WE)
 	string(REPLACE test test_ testname ${filename})
+	if(kst_verbose)
+		message(STATUS "Building test ${testname}")
+	endif()
+
 	kst_init(${testname})
+
 	set(moc_file)
 	qt4_wrap_cpp(moc_file ${header} OPTIONS "-nw")
-	kst_add_executable(${kst_dir}/tests/${filename}.cpp ${header} ${moc_file})
+
+	kst_add_executable(
+		${kst_dir}/tests/ksttest.h
+		${kst_dir}/tests/${filename}.cpp
+		${header} ${moc_file})
+
 	kst_link(kstcore kstmath ${QT_QTTEST_LIBRARY})
+
 	add_test(NAME ${testname} COMMAND ${testname})
-	message(STATUS "Adding test: ${testname}")
+
+	# Some file grouping in Studio
+	kst_flat_source_group()
+	source_group(Generated FILES ${moc_file})
 endforeach()
 
 message(STATUS)
+message(STATUS "Tests added, to run them call 'make test'")
+message(STATUS)
 
 # like done with qmake
 #add_subdirectory(allinone)


More information about the Kst mailing list