Remove dependency on Qt3 support from qmake tests
[qt-netbsd.git] / tests / auto / qmake / testcompiler.h
blob12d8878ad547704cec30dc93a72188ae01de191b
1 /****************************************************************************
2 **
3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
4 ** Contact: Qt Software Information (qt-info@nokia.com)
5 **
6 ** This file is part of the test suite of the Qt Toolkit.
7 **
8 ** $QT_BEGIN_LICENSE:LGPL$
9 ** No Commercial Usage
10 ** This file contains pre-release code and may not be distributed.
11 ** You may use this file in accordance with the terms and conditions
12 ** contained in the either Technology Preview License Agreement or the
13 ** Beta Release License Agreement.
15 ** GNU Lesser General Public License Usage
16 ** Alternatively, this file may be used under the terms of the GNU Lesser
17 ** General Public License version 2.1 as published by the Free Software
18 ** Foundation and appearing in the file LICENSE.LGPL included in the
19 ** packaging of this file. Please review the following information to
20 ** ensure the GNU Lesser General Public License version 2.1 requirements
21 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
23 ** In addition, as a special exception, Nokia gives you certain
24 ** additional rights. These rights are described in the Nokia Qt LGPL
25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
26 ** package.
28 ** GNU General Public License Usage
29 ** Alternatively, this file may be used under the terms of the GNU
30 ** General Public License version 3.0 as published by the Free Software
31 ** Foundation and appearing in the file LICENSE.GPL included in the
32 ** packaging of this file. Please review the following information to
33 ** ensure the GNU General Public License version 3.0 requirements will be
34 ** met: http://www.gnu.org/copyleft/gpl.html.
36 ** If you are unsure which license is appropriate for your use, please
37 ** contact the sales department at qt-sales@nokia.com.
38 ** $QT_END_LICENSE$
40 ****************************************************************************/
41 #ifndef TESTCOMPILER_H
42 #define TESTCOMPILER_H
44 #include <qobject.h>
45 #include <qstringlist.h>
47 #define COMPILE_ERROR "Compile error"
48 #define COMPILE_SUCCESS "Compile successfull"
49 #define COMPILE_NOT_AVAIL "Binary not available for testing"
50 #define SELF_TEST "self-test"
52 enum BuildType { Exe, Dll, Lib, Plain };
54 class TestCompiler : public QObject
56 Q_OBJECT
58 public:
59 TestCompiler();
60 virtual ~TestCompiler();
62 void setBaseCommands( QString makeCmd, QString qmakeCmd );
64 // builds a complete project, e.g. qmake, make clean, make and exists.
65 bool buildProject( const QString &project, BuildType buildType, const QString &targetName, const QString &destPath, const QString &version );
67 // executes a make clean in the specified workPath
68 bool makeClean( const QString &workPath );
69 // executes a make dist clean in the specified workPath
70 bool makeDistClean( const QString &workPath );
71 // executes a qmake on proName in the specified workDir, output goes to buildDir or workDir if it's null
72 bool qmake( const QString &workDir, const QString &proName, const QString &buildDir = QString() );
73 // executes a make in the specified workPath, with an optional target (eg. install)
74 bool make( const QString &workPath, const QString &target = QString() );
75 // executes a make clean and then deletes the makefile in workpath + deletes the executable
76 // in destPath.
77 bool cleanAll( const QString &workPath, const QString &destPath, const QString &exeName, const QString &exeExt );
78 // checks if the executable exists in destDir
79 bool exists( const QString &destDir, const QString &exeName, BuildType buildType, const QString &version );
80 // removes the makefile
81 bool removeMakefile( const QString &workPath );
83 private:
84 bool runCommand( QString cmdLine );
86 QString makeCmd_;
87 QString qmakeCmd_;
89 // need to make this available somewhere
90 QStringList testOutput_;
93 #endif // TESTCOMPILER_H