From: Stephen Kelly Date: Wed, 18 Apr 2012 14:46:26 +0000 (+0200) Subject: Move the CMake unit tests to auto/ X-Git-Tag: 071012110112~1471 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=61c433785eb918d81b927f17bcad4687f2269afe;p=profile%2Fivi%2Fqtbase.git Move the CMake unit tests to auto/ This will allow the CI system to run the tests. The tests are only run if cmake is found. Change-Id: Ie73a56114c151871160bafcbf0b90b2d54620855 Reviewed-by: Oswald Buddenhagen Reviewed-by: Stephen Kelly Reviewed-by: Sergio Ahumada --- diff --git a/tests/auto/auto.pro b/tests/auto/auto.pro index 2322112..bd69fa1 100644 --- a/tests/auto/auto.pro +++ b/tests/auto/auto.pro @@ -14,6 +14,7 @@ SUBDIRS += \ other \ widgets \ printsupport \ + cmake cross_compile: SUBDIRS -= tools !contains(QT_CONFIG, opengl): SUBDIRS -= opengl diff --git a/tests/manual/cmake/CMakeLists.txt b/tests/auto/cmake/CMakeLists.txt similarity index 100% rename from tests/manual/cmake/CMakeLists.txt rename to tests/auto/cmake/CMakeLists.txt diff --git a/tests/auto/cmake/cmake.pro b/tests/auto/cmake/cmake.pro new file mode 100644 index 0000000..9767914 --- /dev/null +++ b/tests/auto/cmake/cmake.pro @@ -0,0 +1,50 @@ + +CMAKE_VERSION = $$system(cmake --version) + +# Cause make to do nothing. +TEMPLATE = subdirs + +check.commands = +isEmpty(CMAKE_VERSION) { + message("cmake executable not found. Not running CMake unit tests") +} else { + CTEST_VERSION = $$system(ctest --version) + isEmpty(CTEST_VERSION) { + message("ctest executable not found. Not running CMake unit tests") + } else { + CMAKE_VERSION = $$last(CMAKE_VERSION) + CMAKE_VERSION_MAJOR = $$section(CMAKE_VERSION, ., 0, 0) + CMAKE_VERSION_MINOR = $$section(CMAKE_VERSION, ., 1, 1) + CMAKE_VERSION_PATCH = $$section(CMAKE_VERSION, ., 2, 2) + + VERSION_OK = + greaterThan(CMAKE_VERSION_MAJOR, 2) { + VERSION_OK = 1 + } else:greaterThan(CMAKE_VERSION_MAJOR, 1):greaterThan(CMAKE_VERSION_MINOR, 8) { + VERSION_OK = 1 + } else:greaterThan(CMAKE_VERSION_MAJOR, 1):greaterThan(CMAKE_VERSION_MINOR, 7):greaterThan(CMAKE_VERSION_PATCH, 2) { + VERSION_OK = 1 + } + + isEmpty(VERSION_OK) { + message("cmake $$CMAKE_VERSION is too old for this test.") + } else { + SET = set + equals(QMAKE_DIR_SEP, "/"):SET = export + + CMAKE_BUILD_TYPE = Debug + CONFIG(release, debug|release):CMAKE_BUILD_TYPE = Release + + BUILD_DIR = $$replace($$list($$OUT_PWD/build), /, $$QMAKE_DIR_SEP) + + check.commands = \ + cd . && $$SET CMAKE_PREFIX_PATH=$$[QT_INSTALL_PREFIX] && \ + $(MKDIR) $$BUILD_DIR && cd $$BUILD_DIR && \ + cmake $$_PRO_FILE_PWD_ -DCMAKE_BUILD_TYPE=$${CMAKE_BUILD_TYPE} && \ + $(TESTRUNNER) ctest --output-on-failure + + } + } +} + +QMAKE_EXTRA_TARGETS *= check diff --git a/tests/manual/cmake/fail4/CMakeLists.txt b/tests/auto/cmake/fail4/CMakeLists.txt similarity index 100% rename from tests/manual/cmake/fail4/CMakeLists.txt rename to tests/auto/cmake/fail4/CMakeLists.txt diff --git a/tests/manual/cmake/fail5/myobject.cpp b/tests/auto/cmake/fail4/myobject.cpp similarity index 100% rename from tests/manual/cmake/fail5/myobject.cpp rename to tests/auto/cmake/fail4/myobject.cpp diff --git a/tests/manual/cmake/pass2/myobject.h b/tests/auto/cmake/fail4/myobject.h similarity index 100% rename from tests/manual/cmake/pass2/myobject.h rename to tests/auto/cmake/fail4/myobject.h diff --git a/tests/manual/cmake/fail4/pass4.qrc b/tests/auto/cmake/fail4/pass4.qrc similarity index 100% rename from tests/manual/cmake/fail4/pass4.qrc rename to tests/auto/cmake/fail4/pass4.qrc diff --git a/tests/manual/cmake/pass2/resource_file.txt b/tests/auto/cmake/fail4/resource_file.txt similarity index 100% rename from tests/manual/cmake/pass2/resource_file.txt rename to tests/auto/cmake/fail4/resource_file.txt diff --git a/tests/manual/cmake/fail5/CMakeLists.txt b/tests/auto/cmake/fail5/CMakeLists.txt similarity index 100% rename from tests/manual/cmake/fail5/CMakeLists.txt rename to tests/auto/cmake/fail5/CMakeLists.txt diff --git a/tests/manual/cmake/fail4/myobject.cpp b/tests/auto/cmake/fail5/myobject.cpp similarity index 100% rename from tests/manual/cmake/fail4/myobject.cpp rename to tests/auto/cmake/fail5/myobject.cpp diff --git a/tests/manual/cmake/fail5/myobject.h b/tests/auto/cmake/fail5/myobject.h similarity index 100% rename from tests/manual/cmake/fail5/myobject.h rename to tests/auto/cmake/fail5/myobject.h diff --git a/tests/manual/cmake/pass(needsquoting)6/CMakeLists.txt b/tests/auto/cmake/pass(needsquoting)6/CMakeLists.txt similarity index 100% rename from tests/manual/cmake/pass(needsquoting)6/CMakeLists.txt rename to tests/auto/cmake/pass(needsquoting)6/CMakeLists.txt diff --git a/tests/manual/cmake/pass3/mywidget.cpp b/tests/auto/cmake/pass(needsquoting)6/mywidget.cpp similarity index 100% rename from tests/manual/cmake/pass3/mywidget.cpp rename to tests/auto/cmake/pass(needsquoting)6/mywidget.cpp diff --git a/tests/manual/cmake/pass3/mywidget.h b/tests/auto/cmake/pass(needsquoting)6/mywidget.h similarity index 100% rename from tests/manual/cmake/pass3/mywidget.h rename to tests/auto/cmake/pass(needsquoting)6/mywidget.h diff --git a/tests/manual/cmake/pass3/mywidget.ui b/tests/auto/cmake/pass(needsquoting)6/mywidget.ui similarity index 100% rename from tests/manual/cmake/pass3/mywidget.ui rename to tests/auto/cmake/pass(needsquoting)6/mywidget.ui diff --git a/tests/manual/cmake/pass1/CMakeLists.txt b/tests/auto/cmake/pass1/CMakeLists.txt similarity index 100% rename from tests/manual/cmake/pass1/CMakeLists.txt rename to tests/auto/cmake/pass1/CMakeLists.txt diff --git a/tests/manual/cmake/pass1/three.cpp b/tests/auto/cmake/pass1/three.cpp similarity index 100% rename from tests/manual/cmake/pass1/three.cpp rename to tests/auto/cmake/pass1/three.cpp diff --git a/tests/manual/cmake/pass1/two.cpp b/tests/auto/cmake/pass1/two.cpp similarity index 100% rename from tests/manual/cmake/pass1/two.cpp rename to tests/auto/cmake/pass1/two.cpp diff --git a/tests/manual/cmake/pass2/CMakeLists.txt b/tests/auto/cmake/pass2/CMakeLists.txt similarity index 100% rename from tests/manual/cmake/pass2/CMakeLists.txt rename to tests/auto/cmake/pass2/CMakeLists.txt diff --git a/tests/manual/cmake/pass2/myobject.cpp b/tests/auto/cmake/pass2/myobject.cpp similarity index 100% rename from tests/manual/cmake/pass2/myobject.cpp rename to tests/auto/cmake/pass2/myobject.cpp diff --git a/tests/manual/cmake/fail4/myobject.h b/tests/auto/cmake/pass2/myobject.h similarity index 100% rename from tests/manual/cmake/fail4/myobject.h rename to tests/auto/cmake/pass2/myobject.h diff --git a/tests/manual/cmake/pass2/pass2.qrc b/tests/auto/cmake/pass2/pass2.qrc similarity index 100% rename from tests/manual/cmake/pass2/pass2.qrc rename to tests/auto/cmake/pass2/pass2.qrc diff --git a/tests/manual/cmake/fail4/resource_file.txt b/tests/auto/cmake/pass2/resource_file.txt similarity index 100% rename from tests/manual/cmake/fail4/resource_file.txt rename to tests/auto/cmake/pass2/resource_file.txt diff --git a/tests/manual/cmake/pass3/CMakeLists.txt b/tests/auto/cmake/pass3/CMakeLists.txt similarity index 100% rename from tests/manual/cmake/pass3/CMakeLists.txt rename to tests/auto/cmake/pass3/CMakeLists.txt diff --git a/tests/manual/cmake/pass(needsquoting)6/mywidget.cpp b/tests/auto/cmake/pass3/mywidget.cpp similarity index 100% rename from tests/manual/cmake/pass(needsquoting)6/mywidget.cpp rename to tests/auto/cmake/pass3/mywidget.cpp diff --git a/tests/manual/cmake/pass(needsquoting)6/mywidget.h b/tests/auto/cmake/pass3/mywidget.h similarity index 100% rename from tests/manual/cmake/pass(needsquoting)6/mywidget.h rename to tests/auto/cmake/pass3/mywidget.h diff --git a/tests/manual/cmake/pass(needsquoting)6/mywidget.ui b/tests/auto/cmake/pass3/mywidget.ui similarity index 100% rename from tests/manual/cmake/pass(needsquoting)6/mywidget.ui rename to tests/auto/cmake/pass3/mywidget.ui diff --git a/tests/manual/cmake/pass7/CMakeLists.txt b/tests/auto/cmake/pass7/CMakeLists.txt similarity index 100% rename from tests/manual/cmake/pass7/CMakeLists.txt rename to tests/auto/cmake/pass7/CMakeLists.txt diff --git a/tests/manual/cmake/pass7/main.cpp b/tests/auto/cmake/pass7/main.cpp similarity index 100% rename from tests/manual/cmake/pass7/main.cpp rename to tests/auto/cmake/pass7/main.cpp diff --git a/tests/manual/cmake/pass8/CMakeLists.txt b/tests/auto/cmake/pass8/CMakeLists.txt similarity index 100% rename from tests/manual/cmake/pass8/CMakeLists.txt rename to tests/auto/cmake/pass8/CMakeLists.txt diff --git a/tests/manual/cmake/pass8/myobject.cpp b/tests/auto/cmake/pass8/myobject.cpp similarity index 100% rename from tests/manual/cmake/pass8/myobject.cpp rename to tests/auto/cmake/pass8/myobject.cpp diff --git a/tests/manual/cmake/pass8/myobject.h b/tests/auto/cmake/pass8/myobject.h similarity index 100% rename from tests/manual/cmake/pass8/myobject.h rename to tests/auto/cmake/pass8/myobject.h diff --git a/tests/manual/cmake/pass9/CMakeLists.txt b/tests/auto/cmake/pass9/CMakeLists.txt similarity index 100% rename from tests/manual/cmake/pass9/CMakeLists.txt rename to tests/auto/cmake/pass9/CMakeLists.txt diff --git a/tests/manual/cmake/pass9/mydbusobject.cpp b/tests/auto/cmake/pass9/mydbusobject.cpp similarity index 100% rename from tests/manual/cmake/pass9/mydbusobject.cpp rename to tests/auto/cmake/pass9/mydbusobject.cpp diff --git a/tests/manual/cmake/pass9/mydbusobject.h b/tests/auto/cmake/pass9/mydbusobject.h similarity index 100% rename from tests/manual/cmake/pass9/mydbusobject.h rename to tests/auto/cmake/pass9/mydbusobject.h