summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRhys Weatherley <rhys.weatherley@nokia.com>2010-12-09 10:44:35 +1000
committerRhys Weatherley <rhys.weatherley@nokia.com>2010-12-09 10:44:35 +1000
commit0298da6b7a93b87e951ce04b6b88bdbfe87db9c8 (patch)
treee6b17a11973c529f734deab262a6d42556574b23
parentee8c0f87ef97dd4a201fde74a6b586fe399fbe21 (diff)
QTEST_QUICK -> QUICK_TEST
-rw-r--r--doc/testcases.txt10
-rw-r--r--src/quicktestlib/QtQuickTest/quicktest.h22
-rw-r--r--src/quicktestlib/quicktest.cpp6
-rw-r--r--tests/qmlauto/qmlauto.pro2
-rw-r--r--tests/qmlauto/tst_qmlauto.cpp2
-rw-r--r--tests/qmlexample/tst_qmlexample.cpp2
6 files changed, 22 insertions, 22 deletions
diff --git a/doc/testcases.txt b/doc/testcases.txt
index 8fbf832..fe655dd 100644
--- a/doc/testcases.txt
+++ b/doc/testcases.txt
@@ -32,7 +32,7 @@ The test cases are launched by a C++ harness that consists of
the following code:
#include <QtQuickTest/quicktest.h>
- QTEST_QUICK_MAIN(qmlexample)
+ QUICK_TEST_MAIN(qmlexample)
Where "qmlexample" is an identifier to use to uniquely identify
this set of tests. You should add "CONFIG += qmltestcase" to your
@@ -55,13 +55,13 @@ is an example .qrc file:
</qresource>
</RCC>
-The QTEST_QUICK_SOURCE_DIR macro can be defined at compile time to
+The QUICK_TEST_SOURCE_DIR macro can be defined at compile time to
run tests from plain files without binding them into resources.
Modify your .pro file to include the following line:
- DEFINES += QTEST_QUICK_SOURCE_DIR=\"\\\"$$PWD\\\"\"
+ DEFINES += QUICK_TEST_SOURCE_DIR=\"\\\"$$PWD\\\"\"
-The QTEST_QUICK_SOURCE_DIR environment variable can also be set
+The QUICK_TEST_SOURCE_DIR environment variable can also be set
at runtime to run test cases from a different directory. This may
be needed to run tests on a target device where the compiled-in
directory name refers to a host.
@@ -71,7 +71,7 @@ used by the test.
See "tests/qmlexample" for an example of creating a test harness
that uses resources and "tests/qmlauto" for an example that uses
-the QTEST_QUICK_SOURCE_DIR macro.
+the QUICK_TEST_SOURCE_DIR macro.
Basic test cases
================
diff --git a/src/quicktestlib/QtQuickTest/quicktest.h b/src/quicktestlib/QtQuickTest/quicktest.h
index b68c554..60c25ec 100644
--- a/src/quicktestlib/QtQuickTest/quicktest.h
+++ b/src/quicktestlib/QtQuickTest/quicktest.h
@@ -50,44 +50,44 @@
QT_BEGIN_NAMESPACE
-typedef QWidget *(*qtest_create_viewport)();
+typedef QWidget *(*quick_test_viewport_create)();
-Q_QUICK_TEST_EXPORT int qtest_quick_main(int argc, char **argv, const char *name, qtest_create_viewport createViewport, const char *sourceDir);
+Q_QUICK_TEST_EXPORT int quick_test_main(int argc, char **argv, const char *name, quick_test_viewport_create createViewport, const char *sourceDir);
-#ifdef QTEST_QUICK_SOURCE_DIR
+#ifdef QUICK_TEST_SOURCE_DIR
-#define QTEST_QUICK_MAIN(name) \
+#define QUICK_TEST_MAIN(name) \
int main(int argc, char **argv) \
{ \
- return qtest_quick_main(argc, argv, #name, 0, QTEST_QUICK_SOURCE_DIR); \
+ return quick_test_main(argc, argv, #name, 0, QUICK_TEST_SOURCE_DIR); \
}
-#define QTEST_QUICK_OPENGL_MAIN(name) \
+#define QUICK_TEST_OPENGL_MAIN(name) \
static QWidget *name##_create_viewport() \
{ \
return new QGLWidget(); \
} \
int main(int argc, char **argv) \
{ \
- return qtest_quick_main(argc, argv, #name, name##_create_viewport, QTEST_QUICK_SOURCE_DIR); \
+ return quick_test_main(argc, argv, #name, name##_create_viewport, QUICK_TEST_SOURCE_DIR); \
}
#else
-#define QTEST_QUICK_MAIN(name) \
+#define QUICK_TEST_MAIN(name) \
int main(int argc, char **argv) \
{ \
- return qtest_quick_main(argc, argv, #name, 0, 0); \
+ return quick_test_main(argc, argv, #name, 0, 0); \
}
-#define QTEST_QUICK_OPENGL_MAIN(name) \
+#define QUICK_TEST_OPENGL_MAIN(name) \
static QWidget *name##_create_viewport() \
{ \
return new QGLWidget(); \
} \
int main(int argc, char **argv) \
{ \
- return qtest_quick_main(argc, argv, #name, name##_create_viewport, 0); \
+ return quick_test_main(argc, argv, #name, name##_create_viewport, 0); \
}
#endif
diff --git a/src/quicktestlib/quicktest.cpp b/src/quicktestlib/quicktest.cpp
index f1afc0a..d4e9fe3 100644
--- a/src/quicktestlib/quicktest.cpp
+++ b/src/quicktestlib/quicktest.cpp
@@ -96,13 +96,13 @@ private:
bool m_windowShown;
};
-int qtest_quick_main(int argc, char **argv, const char *name, qtest_create_viewport createViewport, const char *sourceDir)
+int quick_test_main(int argc, char **argv, const char *name, quick_test_viewport_create createViewport, const char *sourceDir)
{
QApplication app(argc, argv);
- // Determine where to look for the test data. If QTEST_QUICK_SOURCE_DIR
+ // Determine where to look for the test data. If QUICK_TEST_SOURCE_DIR
// is set, then use that. Otherwise scan the application's resources.
- QString testPath = QString::fromLocal8Bit(qgetenv("QTEST_QUICK_SOURCE_DIR"));
+ QString testPath = QString::fromLocal8Bit(qgetenv("QUICK_TEST_SOURCE_DIR"));
if (testPath.isEmpty() && sourceDir)
testPath = QString::fromLocal8Bit(sourceDir);
if (testPath.isEmpty())
diff --git a/tests/qmlauto/qmlauto.pro b/tests/qmlauto/qmlauto.pro
index fa0c2dc..2c0fb9c 100644
--- a/tests/qmlauto/qmlauto.pro
+++ b/tests/qmlauto/qmlauto.pro
@@ -2,5 +2,5 @@ TEMPLATE=app
TARGET=tst_qmlauto
CONFIG += warn_on testcase
SOURCES += tst_qmlauto.cpp
-DEFINES += QTEST_QUICK_SOURCE_DIR=\"\\\"$$PWD\\\"\"
+DEFINES += QUICK_TEST_SOURCE_DIR=\"\\\"$$PWD\\\"\"
include(../../src/quicktestlib/quicktestlib_dep.pri)
diff --git a/tests/qmlauto/tst_qmlauto.cpp b/tests/qmlauto/tst_qmlauto.cpp
index 1ff2f46..37d47ac 100644
--- a/tests/qmlauto/tst_qmlauto.cpp
+++ b/tests/qmlauto/tst_qmlauto.cpp
@@ -40,4 +40,4 @@
****************************************************************************/
#include <QtQuickTest/quicktest.h>
-QTEST_QUICK_MAIN(qmlauto)
+QUICK_TEST_MAIN(qmlauto)
diff --git a/tests/qmlexample/tst_qmlexample.cpp b/tests/qmlexample/tst_qmlexample.cpp
index 3cc5b2f..47742bf 100644
--- a/tests/qmlexample/tst_qmlexample.cpp
+++ b/tests/qmlexample/tst_qmlexample.cpp
@@ -40,4 +40,4 @@
****************************************************************************/
#include <QtQuickTest/quicktest.h>
-QTEST_QUICK_MAIN(qmlexample)
+QUICK_TEST_MAIN(qmlexample)