diff options
author | Rhys Weatherley <rhys.weatherley@nokia.com> | 2010-12-09 09:50:27 +1000 |
---|---|---|
committer | Rhys Weatherley <rhys.weatherley@nokia.com> | 2010-12-09 09:50:27 +1000 |
commit | c06d64bb49c26e13d8aa27275838389484bb64a0 (patch) | |
tree | a8bf10fc45d9b1d5d8507302f1f57bc7f35545c1 | |
parent | 2dbed27be16066b2dd4b17f960758171c610daea (diff) |
Use QtQuickTest as the uniform name for the module
-rw-r--r-- | README | 4 | ||||
-rw-r--r-- | doc/testcases.txt | 14 | ||||
-rw-r--r-- | src/imports/testlib/TestCase.qml | 24 | ||||
-rw-r--r-- | src/imports/testlib/main.cpp | 2 | ||||
-rw-r--r-- | src/imports/testlib/testlib.pro | 4 | ||||
-rw-r--r-- | src/quicktestlib/qdeclarativetest.h | 2 | ||||
-rw-r--r-- | src/quicktestlib/qdeclarativetestresult_p.h | 2 | ||||
-rw-r--r-- | src/quicktestlib/quicktestglobal.h | 16 | ||||
-rw-r--r-- | src/quicktestlib/quicktestlib.pro | 8 | ||||
-rw-r--r-- | src/quicktestlib/quicktestlib_dep.pri | 6 | ||||
-rw-r--r-- | tests/qmlauto/buttonclick/tst_buttonclick.qml | 2 | ||||
-rw-r--r-- | tests/qmlauto/qdecarativebinding/tst_binding.qml | 2 | ||||
-rw-r--r-- | tests/qmlauto/qdecarativebinding/tst_binding2.qml | 2 | ||||
-rw-r--r-- | tests/qmlauto/qdecarativeborderimage/tst_borderimage.qml | 2 | ||||
-rw-r--r-- | tests/qmlexample/tst_basic.qml | 2 | ||||
-rw-r--r-- | tests/qmlexample/tst_item.qml | 2 |
16 files changed, 47 insertions, 47 deletions
@@ -1,6 +1,6 @@ -QtTest module for Qt Quick -========================== +QtQuickTest module for Qt Quick +=============================== This directory contains an experimental module and test harness for writing QTestLib-style unit tests in QML. Build it against diff --git a/doc/testcases.txt b/doc/testcases.txt index 68c963a..405edae 100644 --- a/doc/testcases.txt +++ b/doc/testcases.txt @@ -31,7 +31,7 @@ Organization of test cases The test cases are launched by a C++ harness that consists of the following code: - #include <QtTestQuick/qdeclarativetest.h> + #include <QtQuickTest/qdeclarativetest.h> QTEST_QUICK_MAIN(qmlexample) Where "qmlexample" is an identifier to use to uniquely identify @@ -72,8 +72,8 @@ Basic test cases Test cases are written as JavaScript functions within a "TestCase" element: ---------------------- -import Qt 4.7 -import QtTest 1.0 +import QtQuick 1.0 +import QtQuickTest 1.0 TestCase { name: "MathTests" @@ -167,8 +167,8 @@ Table data can be provided to a test using a function name that ends with "_data": ---------------------- -import Qt 4.7 -import QtTest 1.0 +import QtQuick 1.0 +import QtQuickTest 1.0 TestCase { name: "DataTests" @@ -209,8 +209,8 @@ only when a certain condition is true. For example, the following example runs a test when the user presses the mouse button: ---------------------- -import Qt 4.7 -import QtTest 1.0 +import QtQuick 1.0 +import QtQuickTest 1.0 Rectangle { id: foo diff --git a/src/imports/testlib/TestCase.qml b/src/imports/testlib/TestCase.qml index 4e03e51..37a6e66 100644 --- a/src/imports/testlib/TestCase.qml +++ b/src/imports/testlib/TestCase.qml @@ -39,8 +39,8 @@ ** ****************************************************************************/ -import Qt 4.7 -import QtTest 1.0 +import QtQuick 1.0 +import QtQuickTest 1.0 import "testlogger.js" as TestLogger Item { @@ -65,7 +65,7 @@ Item { // Property that is set to true when the main window is shown. // We need to set the property value in an odd way to handle - // both qmlviewer and the QtTest module test wrapper. + // both qmlviewer and the QtQuickTest module test wrapper. property bool windowShown: Qt.qtest_wrapper ? qtest.windowShown : false // Internal private state @@ -79,14 +79,14 @@ Item { if (!msg) msg = ""; results.fail(msg, Qt.qtest_caller_file(), Qt.qtest_caller_line()) - throw new Error("QtTest::fail") + throw new Error("QtQuickTest::fail") } function verify(cond, msg) { if (!msg) msg = ""; if (!results.verify(cond, msg, Qt.qtest_caller_file(), Qt.qtest_caller_line())) - throw new Error("QtTest::fail") + throw new Error("QtQuickTest::fail") } function compareInternal(actual, expected) { @@ -129,7 +129,7 @@ Item { if (!msg) msg = "" if (!results.compare(success, msg, act, exp, Qt.qtest_caller_file(), Qt.qtest_caller_line())) - throw new Error("QtTest::fail") + throw new Error("QtQuickTest::fail") } function tryCompare(obj, prop, value, timeout) { @@ -147,21 +147,21 @@ Item { var exp = formatValue(value) var success = compareInternal(actual, value) if (!results.compare(success, "property " + prop, act, exp, Qt.qtest_caller_file(), Qt.qtest_caller_line())) - throw new Error("QtTest::fail") + throw new Error("QtQuickTest::fail") } function skip(msg) { if (!msg) msg = "" results.skipSingle(msg, Qt.qtest_caller_file(), Qt.qtest_caller_line()) - throw new Error("QtTest::skip") + throw new Error("QtQuickTest::skip") } function skipAll(msg) { if (!msg) msg = "" results.skipAll(msg, Qt.qtest_caller_file(), Qt.qtest_caller_line()) - throw new Error("QtTest::skip") + throw new Error("QtQuickTest::skip") } function expectFail(tag, msg) { @@ -170,7 +170,7 @@ Item { if (!msg) msg = "" if (!results.expectFail(tag, msg, Qt.qtest_caller_file(), Qt.qtest_caller_line())) - throw new Error("QtTest::expectFail") + throw new Error("QtQuickTest::expectFail") } function expectFailContinue(tag, msg) { @@ -179,7 +179,7 @@ Item { if (!msg) msg = "" if (!results.expectFailContinue(tag, msg, Qt.qtest_caller_file(), Qt.qtest_caller_line())) - throw new Error("QtTest::expectFail") + throw new Error("QtQuickTest::expectFail") } function warn(msg) { @@ -213,7 +213,7 @@ Item { testCaseResult = testCase[prop](arg) } catch (e) { testCaseResult = [] - if (e.message.indexOf("QtTest::") != 0) { + if (e.message.indexOf("QtQuickTest::") != 0) { // Test threw an unrecognized exception - fail. fail(e.message) } diff --git a/src/imports/testlib/main.cpp b/src/imports/testlib/main.cpp index 0d65027..d04bccf 100644 --- a/src/imports/testlib/main.cpp +++ b/src/imports/testlib/main.cpp @@ -103,7 +103,7 @@ class QTestQmlModule : public QDeclarativeExtensionPlugin public: virtual void registerTypes(const char *uri) { - Q_ASSERT(QLatin1String(uri) == QLatin1String("QtTest")); + Q_ASSERT(QLatin1String(uri) == QLatin1String("QtQuickTest")); qmlRegisterType<QDeclarativeTestResult>(uri,1,0,"TestResult"); } void initializeEngine(QDeclarativeEngine *engine, const char *) diff --git a/src/imports/testlib/testlib.pro b/src/imports/testlib/testlib.pro index b3b91c9..f1ae659 100644 --- a/src/imports/testlib/testlib.pro +++ b/src/imports/testlib/testlib.pro @@ -21,8 +21,8 @@ qdeclarativesources.files += \ TestCase.qml \ testlogger.js -qdeclarativesources.path += $$[QT_INSTALL_IMPORTS]/QtTest -target.path += $$[QT_INSTALL_IMPORTS]/QtTest +qdeclarativesources.path += $$[QT_INSTALL_IMPORTS]/QtQuickTest +target.path += $$[QT_INSTALL_IMPORTS]/QtQuickTest INSTALLS += qdeclarativesources target include(../../quicktestlib/quicktestlib_dep.pri) diff --git a/src/quicktestlib/qdeclarativetest.h b/src/quicktestlib/qdeclarativetest.h index b76eb72..f89868d 100644 --- a/src/quicktestlib/qdeclarativetest.h +++ b/src/quicktestlib/qdeclarativetest.h @@ -52,7 +52,7 @@ QT_BEGIN_NAMESPACE typedef QWidget *(*qtest_create_viewport)(); -Q_TEST_QUICK_EXPORT int qtest_quick_main(int argc, char **argv, const char *name, qtest_create_viewport createViewport, const char *sourceDir); +Q_QUICK_TEST_EXPORT int qtest_quick_main(int argc, char **argv, const char *name, qtest_create_viewport createViewport, const char *sourceDir); #ifdef QTEST_QUICK_SOURCE_DIR diff --git a/src/quicktestlib/qdeclarativetestresult_p.h b/src/quicktestlib/qdeclarativetestresult_p.h index bb55a78..776a77a 100644 --- a/src/quicktestlib/qdeclarativetestresult_p.h +++ b/src/quicktestlib/qdeclarativetestresult_p.h @@ -51,7 +51,7 @@ QT_BEGIN_NAMESPACE class QDeclarativeTestResultPrivate; -class Q_TEST_QUICK_EXPORT QDeclarativeTestResult : public QObject +class Q_QUICK_TEST_EXPORT QDeclarativeTestResult : public QObject { Q_OBJECT Q_ENUMS(FunctionType) diff --git a/src/quicktestlib/quicktestglobal.h b/src/quicktestlib/quicktestglobal.h index cfdad78..0c71b5c 100644 --- a/src/quicktestlib/quicktestglobal.h +++ b/src/quicktestlib/quicktestglobal.h @@ -44,7 +44,7 @@ #include <QtCore/qglobal.h> -QT_LICENSED_MODULE(QtTestQuick) +QT_LICENSED_MODULE(QtQuickTest) #if defined(Q_OS_WIN) || defined(Q_OS_SYMBIAN) # if defined(QT_NODLL) # undef QT_MAKEDLL @@ -53,20 +53,20 @@ QT_LICENSED_MODULE(QtTestQuick) # if defined(QT_DLL) # undef QT_DLL # endif -# if defined(QT_BUILD_TEST_QUICK_LIB) -# define Q_TEST_QUICK_EXPORT Q_DECL_EXPORT +# if defined(QT_BUILD_QUICK_TEST_LIB) +# define Q_QUICK_TEST_EXPORT Q_DECL_EXPORT # else -# define Q_TEST_QUICK_EXPORT Q_DECL_IMPORT +# define Q_QUICK_TEST_EXPORT Q_DECL_IMPORT # endif # elif defined(QT_DLL) /* use a Qt DLL library */ -# define Q_TEST_QUICK_EXPORT Q_DECL_IMPORT +# define Q_QUICK_TEST_EXPORT Q_DECL_IMPORT # endif #endif -#if !defined(Q_TEST_QUICK_EXPORT) +#if !defined(Q_QUICK_TEST_EXPORT) # if defined(QT_SHARED) -# define Q_TEST_QUICK_EXPORT Q_DECL_EXPORT +# define Q_QUICK_TEST_EXPORT Q_DECL_EXPORT # else -# define Q_TEST_QUICK_EXPORT +# define Q_QUICK_TEST_EXPORT # endif #endif diff --git a/src/quicktestlib/quicktestlib.pro b/src/quicktestlib/quicktestlib.pro index bd29bdf..1ca306e 100644 --- a/src/quicktestlib/quicktestlib.pro +++ b/src/quicktestlib/quicktestlib.pro @@ -1,5 +1,5 @@ TEMPLATE = lib -TARGET = QtTestQuick$${QT_LIBINFIX} +TARGET = QtQuickTest$${QT_LIBINFIX} CONFIG += dll warn_on QT += declarative DESTDIR = ../../lib @@ -38,13 +38,13 @@ HEADERS += $$PRIVATE_HEADERS include(testlib/testlib.pri) -DEFINES += QT_BUILD_TEST_QUICK_LIB +DEFINES += QT_BUILD_QUCIK_TEST_LIB !symbian { target.path += $$[QT_INSTALL_LIBS] INSTALLS += target - install_headers.path = $$[QT_INSTALL_HEADERS]/QtTestQuick + install_headers.path = $$[QT_INSTALL_HEADERS]/QtQuickTest install_headers.files = $$PUBLIC_HEADERS INSTALLS += install_headers } else { @@ -58,7 +58,7 @@ DEFINES += QT_BUILD_TEST_QUICK_LIB for(entry, entries) { exists($$entry) { contains(PUBLIC_HEADERS, $$basename(entry)) { - BLD_INF_RULES.prj_exports += "$$entry $$MW_LAYER_PUBLIC_EXPORT_PATH(QtTestQuick/$$basename(entry))" + BLD_INF_RULES.prj_exports += "$$entry $$MW_LAYER_PUBLIC_EXPORT_PATH(QtQuickTest/$$basename(entry))" } } } diff --git a/src/quicktestlib/quicktestlib_dep.pri b/src/quicktestlib/quicktestlib_dep.pri index a615cd3..9f60c4a 100644 --- a/src/quicktestlib/quicktestlib_dep.pri +++ b/src/quicktestlib/quicktestlib_dep.pri @@ -5,14 +5,14 @@ INCLUDEPATH += $$PWD LIBS += -L../../lib -L../../bin win32:CONFIG(debug, debug|release) { - LIBS += -lQtTestQuick$${QT_LIBINFIX}d + LIBS += -lQtQuickTest$${QT_LIBINFIX}d } else { - LIBS += -lQtTestQuick$${QT_LIBINFIX} + LIBS += -lQtQuickTest$${QT_LIBINFIX} } # Locate the "lib" directory in the build tree and put it before # the Qt "lib" directory in the library path so that we link -# against the libQtTestQuick.so in our build tree, not the Qt one. +# against the libQtQuickTest.so in our build tree, not the Qt one. FIND_TOP=.. for(i,forever) { exists($$_PRO_FILE_PWD_/$$FIND_TOP/qtest-qml.pro):break() diff --git a/tests/qmlauto/buttonclick/tst_buttonclick.qml b/tests/qmlauto/buttonclick/tst_buttonclick.qml index c2d102d..cdd4056 100644 --- a/tests/qmlauto/buttonclick/tst_buttonclick.qml +++ b/tests/qmlauto/buttonclick/tst_buttonclick.qml @@ -40,7 +40,7 @@ ****************************************************************************/ import QtQuick 1.0 -import QtTest 1.0 +import QtQuickTest 1.0 Button { id: button diff --git a/tests/qmlauto/qdecarativebinding/tst_binding.qml b/tests/qmlauto/qdecarativebinding/tst_binding.qml index 3b1cf8a..67c2eb5 100644 --- a/tests/qmlauto/qdecarativebinding/tst_binding.qml +++ b/tests/qmlauto/qdecarativebinding/tst_binding.qml @@ -40,7 +40,7 @@ ****************************************************************************/ import QtQuick 1.0 -import QtTest 1.0 +import QtQuickTest 1.0 Rectangle { id: screen diff --git a/tests/qmlauto/qdecarativebinding/tst_binding2.qml b/tests/qmlauto/qdecarativebinding/tst_binding2.qml index 414800f..ef1fc25 100644 --- a/tests/qmlauto/qdecarativebinding/tst_binding2.qml +++ b/tests/qmlauto/qdecarativebinding/tst_binding2.qml @@ -40,7 +40,7 @@ ****************************************************************************/ import QtQuick 1.0 -import QtTest 1.0 +import QtQuickTest 1.0 Rectangle { id: screen diff --git a/tests/qmlauto/qdecarativeborderimage/tst_borderimage.qml b/tests/qmlauto/qdecarativeborderimage/tst_borderimage.qml index 341f902..5c4eba3 100644 --- a/tests/qmlauto/qdecarativeborderimage/tst_borderimage.qml +++ b/tests/qmlauto/qdecarativeborderimage/tst_borderimage.qml @@ -40,7 +40,7 @@ ****************************************************************************/ import QtQuick 1.0 -import QtTest 1.0 +import QtQuickTest 1.0 Item { id: top diff --git a/tests/qmlexample/tst_basic.qml b/tests/qmlexample/tst_basic.qml index 05e8029..d905d9b 100644 --- a/tests/qmlexample/tst_basic.qml +++ b/tests/qmlexample/tst_basic.qml @@ -40,7 +40,7 @@ ****************************************************************************/ import Qt 4.7 -import QtTest 1.0 +import QtQuickTest 1.0 TestCase { name: "BasicTests" diff --git a/tests/qmlexample/tst_item.qml b/tests/qmlexample/tst_item.qml index 606d3a5..1b09cc2 100644 --- a/tests/qmlexample/tst_item.qml +++ b/tests/qmlexample/tst_item.qml @@ -40,7 +40,7 @@ ****************************************************************************/ import Qt 4.7 -import QtTest 1.0 +import QtQuickTest 1.0 Rectangle { id: foo |