diff options
Diffstat (limited to 'Tests')
-rw-r--r-- | Tests/CMakeLists.txt | 2 | ||||
-rw-r--r-- | Tests/CMakeOnly/MajorVersionSelection/CMakeLists.txt | 6 | ||||
-rw-r--r-- | Tests/FunctionTest/CMakeLists.txt | 2 | ||||
-rw-r--r-- | Tests/MacroTest/CMakeLists.txt | 2 | ||||
-rw-r--r-- | Tests/QtAutogen/CMakeLists.txt | 4 | ||||
-rw-r--r-- | Tests/QtAutogen/multiplewidgets.cpp | 19 | ||||
-rw-r--r-- | Tests/QtAutogen/multiplewidgets.h | 33 | ||||
-rw-r--r-- | Tests/QtAutogen/rcconly.cpp | 9 | ||||
-rw-r--r-- | Tests/QtAutogen/widget1.ui | 45 | ||||
-rw-r--r-- | Tests/QtAutogen/widget2.ui | 29 | ||||
-rw-r--r-- | Tests/RunCMake/CMakeLists.txt | 2 | ||||
-rw-r--r-- | Tests/RunCMake/FindPkgConfig/FindPkgConfig_NO_PKGCONFIG_PATH.cmake | 4 | ||||
-rw-r--r-- | Tests/RunCMake/FindPkgConfig/FindPkgConfig_PKGCONFIG_PATH.cmake | 2 | ||||
-rw-r--r-- | Tests/RunCMake/FindPkgConfig/FindPkgConfig_PKGCONFIG_PATH_NO_CMAKE_ENVIRONMENT_PATH.cmake | 2 | ||||
-rw-r--r-- | Tests/RunCMake/FindPkgConfig/FindPkgConfig_PKGCONFIG_PATH_NO_CMAKE_PATH.cmake | 2 | ||||
-rw-r--r-- | Tests/StringFileTest/CMakeLists.txt | 2 |
16 files changed, 152 insertions, 13 deletions
diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt index acb6b86..25cc846 100644 --- a/Tests/CMakeLists.txt +++ b/Tests/CMakeLists.txt @@ -2638,7 +2638,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DDIR=dev -P ${CMake_SOURCE_DIR}/Utilities/Release set(regex "${regex}|Error message was: ") set(regex "${regex}([Cc]ould *n.t resolve host") set(regex "${regex}|[Cc]ould *n.t connect to host") - set(regex "${regex}|Failed connect to") + set(regex "${regex}|Failed *t*o* connect to") set(regex "${regex}|Empty reply from server") set(regex "${regex}|The requested URL returned error") set(regex "${regex}|libcurl was built with SSL disabled. https: not supported)") diff --git a/Tests/CMakeOnly/MajorVersionSelection/CMakeLists.txt b/Tests/CMakeOnly/MajorVersionSelection/CMakeLists.txt index 74f5451..2511064 100644 --- a/Tests/CMakeOnly/MajorVersionSelection/CMakeLists.txt +++ b/Tests/CMakeOnly/MajorVersionSelection/CMakeLists.txt @@ -20,13 +20,13 @@ endif () string(TOUPPER "${MAJOR_TEST_MODULE}" MODULE_UPPER) -if ( ( ${MAJOR_TEST_MODULE}_FOUND OR ${MODULE_UPPER}_FOUND ) AND "${VERSION_VAR}") +if ( ( ${MAJOR_TEST_MODULE}_FOUND OR ${MODULE_UPPER}_FOUND ) AND ${VERSION_VAR}) message(STATUS "${VERSION_VAR} is '${${VERSION_VAR}}'") - if ("${VERSION_VAR}" VERSION_LESS MAJOR_TEST_VERSION) + if (${VERSION_VAR} VERSION_LESS MAJOR_TEST_VERSION) message(SEND_ERROR "Found version ${${VERSION_VAR}} is less than requested major version ${MAJOR_TEST_VERSION}") endif () math(EXPR V_PLUS_ONE "${MAJOR_TEST_VERSION} + 1") - if ("${VERSION_VAR}" VERSION_GREATER V_PLUS_ONE) + if (${VERSION_VAR} VERSION_GREATER V_PLUS_ONE) message(SEND_ERROR "Found version ${${VERSION_VAR}} is greater than requested major version ${MAJOR_TEST_VERSION}") endif () endif () diff --git a/Tests/FunctionTest/CMakeLists.txt b/Tests/FunctionTest/CMakeLists.txt index d1fada4..68da972 100644 --- a/Tests/FunctionTest/CMakeLists.txt +++ b/Tests/FunctionTest/CMakeLists.txt @@ -92,7 +92,7 @@ endfunction() STRANGE_FUNCTION(var) set(second_var "second_var") -if("${var}" STREQUAL "strange_function" AND "${second_var}" STREQUAL "second_var") +if("x${var}" STREQUAL "xstrange_function" AND "x${second_var}" STREQUAL "xsecond_var") PASS("Case Test" "(${var} ${second_var})") else() FAILED("Case test" "(${var} ${second_var})") diff --git a/Tests/MacroTest/CMakeLists.txt b/Tests/MacroTest/CMakeLists.txt index 02bb31f..6c6dfb6 100644 --- a/Tests/MacroTest/CMakeLists.txt +++ b/Tests/MacroTest/CMakeLists.txt @@ -36,7 +36,7 @@ macro(strange_macro m) endmacro() STRANGE_MACRO(var) set(second_var "second_var") -if("${var}" STREQUAL "strange_macro" AND "${second_var}" STREQUAL "second_var") +if("x${var}" STREQUAL "xstrange_macro" AND "x${second_var}" STREQUAL "xsecond_var") PASS("Case Test" "(${var} ${second_var})") else() FAILED("Case test" "(${var} ${second_var})") diff --git a/Tests/QtAutogen/CMakeLists.txt b/Tests/QtAutogen/CMakeLists.txt index 3973653..3fd00b8 100644 --- a/Tests/QtAutogen/CMakeLists.txt +++ b/Tests/QtAutogen/CMakeLists.txt @@ -37,6 +37,9 @@ else() endif() +add_executable(rcconly rcconly.cpp second_resource.qrc) +set_property(TARGET rcconly PROPERTY AUTORCC ON) +target_link_libraries(rcconly ${QT_QTCORE_TARGET}) include_directories(${CMAKE_CURRENT_BINARY_DIR}) @@ -71,6 +74,7 @@ if (CMAKE_BUILD_TYPE MATCHES "[Dd][Ee][Bb][Uu][Gg]" AND NOT CMAKE_CONFIGURATION_ endif() add_executable(QtAutogen main.cpp calwidget.cpp second_widget.cpp foo.cpp blub.cpp bar.cpp abc.cpp + multiplewidgets.cpp xyz.cpp yaf.cpp gadget.cpp $<TARGET_OBJECTS:privateSlot> test.qrc second_resource.qrc resourcetester.cpp generated.cpp ${debug_srcs} ) diff --git a/Tests/QtAutogen/multiplewidgets.cpp b/Tests/QtAutogen/multiplewidgets.cpp new file mode 100644 index 0000000..f143875 --- /dev/null +++ b/Tests/QtAutogen/multiplewidgets.cpp @@ -0,0 +1,19 @@ + +#include "multiplewidgets.h" + +#include "ui_widget1.h" +#include "ui_widget2.h" + +Widget1::Widget1(QWidget *parent) + : QWidget(parent), + ui(new Ui::Widget1) +{ + ui->setupUi(this); +} + +Widget2::Widget2(QWidget *parent) + : QWidget(parent), + ui(new Ui::Widget2) +{ + ui->setupUi(this); +} diff --git a/Tests/QtAutogen/multiplewidgets.h b/Tests/QtAutogen/multiplewidgets.h new file mode 100644 index 0000000..6ae6ad1 --- /dev/null +++ b/Tests/QtAutogen/multiplewidgets.h @@ -0,0 +1,33 @@ + +#ifndef MULTIPLEWIDGETS_H +#define MULTIPLEWIDGETS_H + +#include <QWidget> + +namespace Ui { +class Widget1; +} + +class Widget1 : public QWidget +{ + Q_OBJECT +public: + Widget1(QWidget *parent = 0); +private: + Ui::Widget1 *ui; +}; + +namespace Ui { +class Widget2; +} + +class Widget2 : public QWidget +{ + Q_OBJECT +public: + Widget2(QWidget *parent = 0); +private: + Ui::Widget2 *ui; +}; + +#endif diff --git a/Tests/QtAutogen/rcconly.cpp b/Tests/QtAutogen/rcconly.cpp new file mode 100644 index 0000000..854c4c1 --- /dev/null +++ b/Tests/QtAutogen/rcconly.cpp @@ -0,0 +1,9 @@ + +extern int qInitResources_second_resource(); + +int main(int, char**) +{ + // Fails to link if the symbol is not present. + qInitResources_second_resource(); + return 0; +} diff --git a/Tests/QtAutogen/widget1.ui b/Tests/QtAutogen/widget1.ui new file mode 100644 index 0000000..8fce81a --- /dev/null +++ b/Tests/QtAutogen/widget1.ui @@ -0,0 +1,45 @@ +<?xml version="1.0" encoding="UTF-8"?> +<ui version="4.0"> + <class>Widget1</class> + <widget class="QWidget" name="Widget1"> + <property name="geometry"> + <rect> + <x>0</x> + <y>0</y> + <width>400</width> + <height>300</height> + </rect> + </property> + <property name="windowTitle"> + <string>Form</string> + </property> + <widget class="QPushButton" name="pushButton"> + <property name="geometry"> + <rect> + <x>140</x> + <y>80</y> + <width>80</width> + <height>23</height> + </rect> + </property> + <property name="text"> + <string>PushButton</string> + </property> + </widget> + <widget class="QPushButton" name="pushButton_2"> + <property name="geometry"> + <rect> + <x>190</x> + <y>170</y> + <width>80</width> + <height>23</height> + </rect> + </property> + <property name="text"> + <string>PushButton</string> + </property> + </widget> + </widget> + <resources/> + <connections/> +</ui> diff --git a/Tests/QtAutogen/widget2.ui b/Tests/QtAutogen/widget2.ui new file mode 100644 index 0000000..1f411b9 --- /dev/null +++ b/Tests/QtAutogen/widget2.ui @@ -0,0 +1,29 @@ +<?xml version="1.0" encoding="UTF-8"?> +<ui version="4.0"> + <class>Widget2</class> + <widget class="QWidget" name="Widget1"> + <property name="geometry"> + <rect> + <x>0</x> + <y>0</y> + <width>400</width> + <height>300</height> + </rect> + </property> + <property name="windowTitle"> + <string>Form</string> + </property> + <widget class="QListWidget" name="listWidget"> + <property name="geometry"> + <rect> + <x>20</x> + <y>20</y> + <width>256</width> + <height>192</height> + </rect> + </property> + </widget> + </widget> + <resources/> + <connections/> +</ui> diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt index 549aed8..fd3bb03 100644 --- a/Tests/RunCMake/CMakeLists.txt +++ b/Tests/RunCMake/CMakeLists.txt @@ -50,7 +50,7 @@ add_RunCMake_test(CMP0051) add_RunCMake_test(CMP0053) add_RunCMake_test(CMP0054) add_RunCMake_test(CTest) -if(UNIX AND "${CMAKE_GENERATOR}" MATCHES "Unix Makefiles") +if(UNIX AND "${CMAKE_GENERATOR}" MATCHES "Unix Makefiles|Ninja") add_RunCMake_test(CompilerChange) endif() add_RunCMake_test(CompilerNotFound) diff --git a/Tests/RunCMake/FindPkgConfig/FindPkgConfig_NO_PKGCONFIG_PATH.cmake b/Tests/RunCMake/FindPkgConfig/FindPkgConfig_NO_PKGCONFIG_PATH.cmake index 924976e..89ce4c6 100644 --- a/Tests/RunCMake/FindPkgConfig/FindPkgConfig_NO_PKGCONFIG_PATH.cmake +++ b/Tests/RunCMake/FindPkgConfig/FindPkgConfig_NO_PKGCONFIG_PATH.cmake @@ -26,7 +26,7 @@ endif() pkg_check_modules(FOO "${expected_path}") -if(NOT "FOO_FOUND") +if(NOT FOO_FOUND) message(FATAL_ERROR "Expected PKG_CONFIG_PATH: \"${expected_path}\".") endif() @@ -36,6 +36,6 @@ set(PKG_CONFIG_USE_CMAKE_PREFIX_PATH TRUE) pkg_check_modules(BAR "${expected_path}" NO_CMAKE_PATH NO_CMAKE_ENVIRONMENT_PATH) -if(NOT "BAR_FOUND") +if(NOT BAR_FOUND) message(FATAL_ERROR "Expected PKG_CONFIG_PATH: \"${expected_path}\".") endif() diff --git a/Tests/RunCMake/FindPkgConfig/FindPkgConfig_PKGCONFIG_PATH.cmake b/Tests/RunCMake/FindPkgConfig/FindPkgConfig_PKGCONFIG_PATH.cmake index 4a66e85..c903279 100644 --- a/Tests/RunCMake/FindPkgConfig/FindPkgConfig_PKGCONFIG_PATH.cmake +++ b/Tests/RunCMake/FindPkgConfig/FindPkgConfig_PKGCONFIG_PATH.cmake @@ -46,6 +46,6 @@ endif() pkg_check_modules(FOO "${expected_path}") -if(NOT "FOO_FOUND") +if(NOT FOO_FOUND) message(FATAL_ERROR "Expected PKG_CONFIG_PATH: \"${expected_path}\".") endif() diff --git a/Tests/RunCMake/FindPkgConfig/FindPkgConfig_PKGCONFIG_PATH_NO_CMAKE_ENVIRONMENT_PATH.cmake b/Tests/RunCMake/FindPkgConfig/FindPkgConfig_PKGCONFIG_PATH_NO_CMAKE_ENVIRONMENT_PATH.cmake index 0b057b8..a52bcbf 100644 --- a/Tests/RunCMake/FindPkgConfig/FindPkgConfig_PKGCONFIG_PATH_NO_CMAKE_ENVIRONMENT_PATH.cmake +++ b/Tests/RunCMake/FindPkgConfig/FindPkgConfig_PKGCONFIG_PATH_NO_CMAKE_ENVIRONMENT_PATH.cmake @@ -46,6 +46,6 @@ endif() pkg_check_modules(FOO "${expected_path}" NO_CMAKE_ENVIRONMENT_PATH) -if(NOT "FOO_FOUND") +if(NOT FOO_FOUND) message(FATAL_ERROR "Expected PKG_CONFIG_PATH: \"${expected_path}\".") endif() diff --git a/Tests/RunCMake/FindPkgConfig/FindPkgConfig_PKGCONFIG_PATH_NO_CMAKE_PATH.cmake b/Tests/RunCMake/FindPkgConfig/FindPkgConfig_PKGCONFIG_PATH_NO_CMAKE_PATH.cmake index a3154f1..2fabe5b 100644 --- a/Tests/RunCMake/FindPkgConfig/FindPkgConfig_PKGCONFIG_PATH_NO_CMAKE_PATH.cmake +++ b/Tests/RunCMake/FindPkgConfig/FindPkgConfig_PKGCONFIG_PATH_NO_CMAKE_PATH.cmake @@ -46,6 +46,6 @@ endif() pkg_check_modules(FOO "${expected_path}" NO_CMAKE_PATH) -if(NOT "FOO_FOUND") +if(NOT FOO_FOUND) message(FATAL_ERROR "Expected PKG_CONFIG_PATH: \"${expected_path}\".") endif() diff --git a/Tests/StringFileTest/CMakeLists.txt b/Tests/StringFileTest/CMakeLists.txt index 683f969..e6c6152 100644 --- a/Tests/StringFileTest/CMakeLists.txt +++ b/Tests/StringFileTest/CMakeLists.txt @@ -123,7 +123,7 @@ string(STRIP "ST2 " ST2) string(STRIP " ST3" ST3) foreach(var ST1 ST2 ST3) - if("${var}" STREQUAL "${${var}}") + if("x${var}" STREQUAL "x${${var}}") message("[${var}] == [${${var}}]") else() message(SEND_ERROR "Problem with the STRIP command for ${var}: [${${var}}]") |