tests/auto/qsharedpointer/externaltests.h
changeset 0 1918ee327afb
child 4 3b1da2848fc7
equal deleted inserted replaced
-1:000000000000 0:1918ee327afb
       
     1 /****************************************************************************
       
     2 **
       
     3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
       
     4 ** All rights reserved.
       
     5 ** Contact: Nokia Corporation (qt-info@nokia.com)
       
     6 **
       
     7 ** This file is part of the test suite of the Qt Toolkit.
       
     8 **
       
     9 ** $QT_BEGIN_LICENSE:LGPL$
       
    10 ** No Commercial Usage
       
    11 ** This file contains pre-release code and may not be distributed.
       
    12 ** You may use this file in accordance with the terms and conditions
       
    13 ** contained in the Technology Preview License Agreement accompanying
       
    14 ** this package.
       
    15 **
       
    16 ** GNU Lesser General Public License Usage
       
    17 ** Alternatively, this file may be used under the terms of the GNU Lesser
       
    18 ** General Public License version 2.1 as published by the Free Software
       
    19 ** Foundation and appearing in the file LICENSE.LGPL included in the
       
    20 ** packaging of this file.  Please review the following information to
       
    21 ** ensure the GNU Lesser General Public License version 2.1 requirements
       
    22 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
       
    23 **
       
    24 ** In addition, as a special exception, Nokia gives you certain additional
       
    25 ** rights.  These rights are described in the Nokia Qt LGPL Exception
       
    26 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
       
    27 **
       
    28 ** If you have questions regarding the use of this file, please contact
       
    29 ** Nokia at qt-info@nokia.com.
       
    30 **
       
    31 **
       
    32 **
       
    33 **
       
    34 **
       
    35 **
       
    36 **
       
    37 **
       
    38 ** $QT_END_LICENSE$
       
    39 **
       
    40 ****************************************************************************/
       
    41 
       
    42 
       
    43 #ifndef QTEST_EXTERNAL_TESTS_H
       
    44 #define QTEST_EXTERNAL_TESTS_H
       
    45 
       
    46 #include <QList>
       
    47 #include <QByteArray>
       
    48 #include <QStringList>
       
    49 
       
    50 QT_BEGIN_NAMESPACE
       
    51 namespace QTest {
       
    52     class QExternalTestPrivate;
       
    53     class QExternalTest
       
    54     {
       
    55     public:
       
    56         QExternalTest();
       
    57         ~QExternalTest();
       
    58 
       
    59         enum Stage {
       
    60             FileStage,
       
    61             QmakeStage,
       
    62             CompilationStage,
       
    63             LinkStage,
       
    64             RunStage
       
    65         };
       
    66 
       
    67         enum QtModule {
       
    68             QtCore      = 0x0001,
       
    69             QtGui       = 0x0002,
       
    70             QtNetwork   = 0x0004,
       
    71             QtXml       = 0x0008,
       
    72             QtXmlPatterns=0x0010,
       
    73             QtOpenGL    = 0x0020,
       
    74             QtSql       = 0x0040,
       
    75             Qt3Support  = 0x0080,
       
    76             QtSvg       = 0x0100,
       
    77             QtScript    = 0x0200,
       
    78             QtTest      = 0x0400,
       
    79             QtDBus      = 0x0800,
       
    80             QtWebKit    = 0x1000,
       
    81             Phonon      = 0x2000 // odd man out
       
    82         };
       
    83         Q_DECLARE_FLAGS(QtModules, QtModule)
       
    84 
       
    85         enum ApplicationType {
       
    86             AutoApplication,
       
    87             Applicationless,
       
    88             QCoreApplication,
       
    89             QApplicationTty,
       
    90             QApplicationGuiClient,
       
    91             QApplicationGuiServer
       
    92         };
       
    93 
       
    94         bool isDebugMode() const;
       
    95         void setDebugMode(bool enable);
       
    96 
       
    97         QList<QByteArray> qmakeSettings() const;
       
    98         void setQmakeSettings(const QList<QByteArray> &settings);
       
    99 
       
   100         QtModules qtModules() const;
       
   101         void setQtModules(QtModules modules);
       
   102 
       
   103         ApplicationType applicationType() const;
       
   104         void setApplicationType(ApplicationType type);
       
   105 
       
   106         QStringList extraProgramSources() const;
       
   107         void setExtraProgramSources(const QStringList &list);
       
   108 
       
   109         QByteArray programHeader() const;
       
   110         void setProgramHeader(const QByteArray &header);
       
   111 
       
   112         // execution:
       
   113         bool tryCompile(const QByteArray &body);
       
   114         bool tryLink(const QByteArray &body);
       
   115         bool tryRun(const QByteArray &body);
       
   116         bool tryCompileFail(const QByteArray &body);
       
   117         bool tryLinkFail(const QByteArray &body);
       
   118         bool tryRunFail(const QByteArray &body);
       
   119 
       
   120         Stage failedStage() const;
       
   121         int exitCode() const;
       
   122         QByteArray fullProgramSource() const;
       
   123         QByteArray standardOutput() const;
       
   124         QByteArray standardError() const;
       
   125 
       
   126         QString errorReport() const;
       
   127 
       
   128     private:
       
   129         QExternalTestPrivate * const d;
       
   130     };
       
   131 
       
   132     Q_DECLARE_OPERATORS_FOR_FLAGS(QExternalTest::QtModules)
       
   133 }
       
   134 QT_END_NAMESPACE
       
   135 
       
   136 #endif