aboutsummaryrefslogtreecommitdiff
path: root/modules-tests/RunAllModuleTests.cmake
diff options
context:
space:
mode:
authorAllen Winter <allen.winter@kdab.com>2011-06-28 17:13:05 -0400
committerAllen Winter <allen.winter@kdab.com>2011-06-28 17:13:05 -0400
commite15ffacc69242c89107afbfda6f8ece9f2b56633 (patch)
tree34bed177321c49f883d9d75616947a18f38c037f /modules-tests/RunAllModuleTests.cmake
parent5c79bed7250cb2f854bfb4f20e4d266925d94b54 (diff)
parentc06badd8d431583071cad638fea082ca0776a0a3 (diff)
downloadextra-cmake-modules-e15ffacc69242c89107afbfda6f8ece9f2b56633.tar.gz
extra-cmake-modules-e15ffacc69242c89107afbfda6f8ece9f2b56633.tar.bz2
Merge branch 'allen' of /data/kde/trunk/KDE/kdelibs
Diffstat (limited to 'modules-tests/RunAllModuleTests.cmake')
-rw-r--r--modules-tests/RunAllModuleTests.cmake59
1 files changed, 59 insertions, 0 deletions
diff --git a/modules-tests/RunAllModuleTests.cmake b/modules-tests/RunAllModuleTests.cmake
new file mode 100644
index 00000000..d68f61fd
--- /dev/null
+++ b/modules-tests/RunAllModuleTests.cmake
@@ -0,0 +1,59 @@
+# Run this script via "cmake -P RunAllModuletests.cmake" to
+# execute all module tests in one go.
+# Run this script with "cmake -DMODULE=foo -P RunAllModuletests.cmake" to
+# test only the one specified module.
+# To see only the results and not the other cmake output,
+# you can grep for "::".
+# To have it delete the previous test build dirs, run it with -DCLEAN_DIRS=TRUE
+
+get_filename_component(currentDir "${CMAKE_CURRENT_LIST_FILE}" PATH)
+
+function(execute_one_test name)
+ set(workingDir "${currentDir}/${name}/build")
+ if(CLEAN_DIRS)
+ file(REMOVE_RECURSE "${workingDir}")
+ endif(CLEAN_DIRS)
+ file(MAKE_DIRECTORY "${workingDir}")
+ execute_process(COMMAND ${CMAKE_COMMAND} "${currentDir}/${name}"
+ WORKING_DIRECTORY "${workingDir}")
+ # now the same with pkg-config disabled
+ set(workingDir "${currentDir}/${name}/build-no-pkgconfig")
+ if(CLEAN_DIRS)
+ file(REMOVE_RECURSE "${workingDir}")
+ endif(CLEAN_DIRS)
+ file(MAKE_DIRECTORY "${workingDir}")
+ execute_process(COMMAND ${CMAKE_COMMAND} -DPKG_CONFIG_EXECUTABLE=echo "${currentDir}/${name}"
+ WORKING_DIRECTORY "${workingDir}")
+endfunction(execute_one_test)
+
+if(DEFINED MODULE)
+ set(modulesToTest ${MODULE})
+else(DEFINED MODULE)
+ set(modulesToTest AGG
+ Blitz
+ BlueZ
+ ENCHANT
+ Eigen2
+ FFmpeg
+ Flac
+ Flex
+ GObject
+ GStreamer
+ LCMS
+ LibArt
+ LibXslt
+ OpenEXR
+ PCRE
+ QCA2
+ QImageBlitz
+ Sqlite
+ Strigi
+ USB
+ Xine
+ Xmms)
+endif(DEFINED MODULE)
+
+foreach(currentModule ${modulesToTest})
+ execute_one_test(${currentModule})
+endforeach(currentModule ${modulesToTest})
+