From ee8c0f87ef97dd4a201fde74a6b586fe399fbe21 Mon Sep 17 00:00:00 2001 From: Rhys Weatherley Date: Thu, 9 Dec 2010 10:39:17 +1000 Subject: Move headers to QtQuickTest directory This should help make the user application code and the example code the same. --- doc/testcases.txt | 2 +- src/quicktestlib/QtQuickTest/quicktest.h | 97 ++++++++++++++++++++++++++ src/quicktestlib/QtQuickTest/quicktestglobal.h | 73 +++++++++++++++++++ src/quicktestlib/quicktest.h | 97 -------------------------- src/quicktestlib/quicktestglobal.h | 73 ------------------- src/quicktestlib/quicktestlib.pro | 6 +- src/quicktestlib/quicktestresult_p.h | 2 +- tests/qmlauto/tst_qmlauto.cpp | 3 +- tests/qmlexample/tst_qmlexample.cpp | 3 +- 9 files changed, 178 insertions(+), 178 deletions(-) create mode 100644 src/quicktestlib/QtQuickTest/quicktest.h create mode 100644 src/quicktestlib/QtQuickTest/quicktestglobal.h delete mode 100644 src/quicktestlib/quicktest.h delete mode 100644 src/quicktestlib/quicktestglobal.h diff --git a/doc/testcases.txt b/doc/testcases.txt index ac7e579..8fbf832 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 + #include QTEST_QUICK_MAIN(qmlexample) Where "qmlexample" is an identifier to use to uniquely identify diff --git a/src/quicktestlib/QtQuickTest/quicktest.h b/src/quicktestlib/QtQuickTest/quicktest.h new file mode 100644 index 0000000..b68c554 --- /dev/null +++ b/src/quicktestlib/QtQuickTest/quicktest.h @@ -0,0 +1,97 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QUICKTEST_H +#define QUICKTEST_H + +#include +#include +#ifdef QT_OPENGL_LIB +#include +#endif + +QT_BEGIN_NAMESPACE + +typedef QWidget *(*qtest_create_viewport)(); + +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 + +#define QTEST_QUICK_MAIN(name) \ + int main(int argc, char **argv) \ + { \ + return qtest_quick_main(argc, argv, #name, 0, QTEST_QUICK_SOURCE_DIR); \ + } + +#define QTEST_QUICK_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); \ + } + +#else + +#define QTEST_QUICK_MAIN(name) \ + int main(int argc, char **argv) \ + { \ + return qtest_quick_main(argc, argv, #name, 0, 0); \ + } + +#define QTEST_QUICK_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); \ + } + +#endif + +QT_END_NAMESPACE + +#endif diff --git a/src/quicktestlib/QtQuickTest/quicktestglobal.h b/src/quicktestlib/QtQuickTest/quicktestglobal.h new file mode 100644 index 0000000..0c71b5c --- /dev/null +++ b/src/quicktestlib/QtQuickTest/quicktestglobal.h @@ -0,0 +1,73 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef TESTQUICKGLOBAL_H +#define TESTQUICKGLOBAL_H + +#include + +QT_LICENSED_MODULE(QtQuickTest) +#if defined(Q_OS_WIN) || defined(Q_OS_SYMBIAN) +# if defined(QT_NODLL) +# undef QT_MAKEDLL +# undef QT_DLL +# elif defined(QT_MAKEDLL) /* create a Qt DLL library */ +# if defined(QT_DLL) +# undef QT_DLL +# endif +# if defined(QT_BUILD_QUICK_TEST_LIB) +# define Q_QUICK_TEST_EXPORT Q_DECL_EXPORT +# else +# define Q_QUICK_TEST_EXPORT Q_DECL_IMPORT +# endif +# elif defined(QT_DLL) /* use a Qt DLL library */ +# define Q_QUICK_TEST_EXPORT Q_DECL_IMPORT +# endif +#endif +#if !defined(Q_QUICK_TEST_EXPORT) +# if defined(QT_SHARED) +# define Q_QUICK_TEST_EXPORT Q_DECL_EXPORT +# else +# define Q_QUICK_TEST_EXPORT +# endif +#endif + +#endif diff --git a/src/quicktestlib/quicktest.h b/src/quicktestlib/quicktest.h deleted file mode 100644 index 4cf64be..0000000 --- a/src/quicktestlib/quicktest.h +++ /dev/null @@ -1,97 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the test suite of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QUICKTEST_H -#define QUICKTEST_H - -#include "quicktestglobal.h" -#include -#ifdef QT_OPENGL_LIB -#include -#endif - -QT_BEGIN_NAMESPACE - -typedef QWidget *(*qtest_create_viewport)(); - -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 - -#define QTEST_QUICK_MAIN(name) \ - int main(int argc, char **argv) \ - { \ - return qtest_quick_main(argc, argv, #name, 0, QTEST_QUICK_SOURCE_DIR); \ - } - -#define QTEST_QUICK_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); \ - } - -#else - -#define QTEST_QUICK_MAIN(name) \ - int main(int argc, char **argv) \ - { \ - return qtest_quick_main(argc, argv, #name, 0, 0); \ - } - -#define QTEST_QUICK_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); \ - } - -#endif - -QT_END_NAMESPACE - -#endif diff --git a/src/quicktestlib/quicktestglobal.h b/src/quicktestlib/quicktestglobal.h deleted file mode 100644 index 0c71b5c..0000000 --- a/src/quicktestlib/quicktestglobal.h +++ /dev/null @@ -1,73 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the test suite of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef TESTQUICKGLOBAL_H -#define TESTQUICKGLOBAL_H - -#include - -QT_LICENSED_MODULE(QtQuickTest) -#if defined(Q_OS_WIN) || defined(Q_OS_SYMBIAN) -# if defined(QT_NODLL) -# undef QT_MAKEDLL -# undef QT_DLL -# elif defined(QT_MAKEDLL) /* create a Qt DLL library */ -# if defined(QT_DLL) -# undef QT_DLL -# endif -# if defined(QT_BUILD_QUICK_TEST_LIB) -# define Q_QUICK_TEST_EXPORT Q_DECL_EXPORT -# else -# define Q_QUICK_TEST_EXPORT Q_DECL_IMPORT -# endif -# elif defined(QT_DLL) /* use a Qt DLL library */ -# define Q_QUICK_TEST_EXPORT Q_DECL_IMPORT -# endif -#endif -#if !defined(Q_QUICK_TEST_EXPORT) -# if defined(QT_SHARED) -# define Q_QUICK_TEST_EXPORT Q_DECL_EXPORT -# else -# define Q_QUICK_TEST_EXPORT -# endif -#endif - -#endif diff --git a/src/quicktestlib/quicktestlib.pro b/src/quicktestlib/quicktestlib.pro index e319c56..52a249e 100644 --- a/src/quicktestlib/quicktestlib.pro +++ b/src/quicktestlib/quicktestlib.pro @@ -24,12 +24,14 @@ symbian { } } +INCLUDEPATH += $$PWD/QtQuickTest + SOURCES += \ quicktest.cpp \ quicktestresult.cpp HEADERS += \ - quicktestglobal.h \ - quicktest.h + QtQuickTest/quicktestglobal.h \ + QtQuickTest/quicktest.h PRIVATE_HEADERS += \ quicktestresult_p.h diff --git a/src/quicktestlib/quicktestresult_p.h b/src/quicktestlib/quicktestresult_p.h index 4896b01..4a283ea 100644 --- a/src/quicktestlib/quicktestresult_p.h +++ b/src/quicktestlib/quicktestresult_p.h @@ -42,7 +42,7 @@ #ifndef QUICKTESTRESULT_P_H #define QUICKTESTRESULT_P_H -#include "quicktestglobal.h" +#include #include #include #include diff --git a/tests/qmlauto/tst_qmlauto.cpp b/tests/qmlauto/tst_qmlauto.cpp index 0e1bd7a..1ff2f46 100644 --- a/tests/qmlauto/tst_qmlauto.cpp +++ b/tests/qmlauto/tst_qmlauto.cpp @@ -39,6 +39,5 @@ ** ****************************************************************************/ -#include "quicktest.h" - +#include QTEST_QUICK_MAIN(qmlauto) diff --git a/tests/qmlexample/tst_qmlexample.cpp b/tests/qmlexample/tst_qmlexample.cpp index 4d9cc40..3cc5b2f 100644 --- a/tests/qmlexample/tst_qmlexample.cpp +++ b/tests/qmlexample/tst_qmlexample.cpp @@ -39,6 +39,5 @@ ** ****************************************************************************/ -#include "quicktest.h" - +#include QTEST_QUICK_MAIN(qmlexample) -- cgit v1.2.3