more autotests for spaces, destdirs and library linking

Change-Id: Ie106d1151e61a50081bccea0a6d0d70728451a5b
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
This commit is contained in:
Oswald Buddenhagen 2014-11-18 14:57:21 +01:00
parent 70f8567429
commit 1cacf1e70d
12 changed files with 56 additions and 37 deletions

View File

@ -0,0 +1 @@
/* a random header file */

View File

@ -31,7 +31,7 @@
**
****************************************************************************/
#include <header.h>
#include <qguiapplication.h>

View File

@ -2,8 +2,12 @@ TEMPLATE = app
TARGET = quotedfilenames
SOURCES = main.cpp
CONFIG += no_batch
INCLUDEPATH += "include folder"
RCCINPUT = "rc folder/test.qrc"
RCCOUTPUT = test.cpp
RCCOUTPUT = "cpp folder/test.cpp"
qtPrepareTool(QMAKE_RCC, rcc)

View File

@ -3,5 +3,5 @@ HEADERS = test_file.h
SOURCES = test_file.cpp \
main.cpp
RESOURCES = test.qrc
TARGET = simple_app
DESTDIR = ./
TARGET = "simple app"
DESTDIR = "dest dir"

View File

@ -10,5 +10,5 @@ VERSION = 1.0.0
INCLUDEPATH += . tmp
MOC_DIR = tmp
OBJECTS_DIR = tmp
TARGET = simple_dll
DESTDIR = ./
TARGET = "simple dll"
DESTDIR = "dest dir"

View File

@ -9,5 +9,5 @@ VERSION = 1.0.0
INCLUDEPATH += . tmp
MOC_DIR = tmp
OBJECTS_DIR = tmp
TARGET = simple_lib
DESTDIR = ./
TARGET = "simple lib"
DESTDIR = "dest dir"

View File

@ -31,7 +31,7 @@
**
****************************************************************************/
#include <simple.h>
#include "test_file.h"
#include <qguiapplication.h>
@ -39,6 +39,7 @@
int main( int argc, char **argv )
{
QGuiApplication a( argc, argv );
Simple s;
SomeObject sc;
return a.exec();
}

View File

@ -2,5 +2,8 @@ TEMPLATE = app
HEADERS = test_file.h
SOURCES = test_file.cpp \
main.cpp
TARGET = simple_app
DESTDIR = ./
TARGET = "simple app"
DESTDIR = "dest dir"
INCLUDEPATH += ../simple_dll
LIBS += -L"../simple_dll/dest dir" -l"simple dll"

View File

@ -35,8 +35,13 @@
#include <qstring.h>
//class SIMPLEDLL_EXPORT Simple
class Simple
#ifdef SIMPLEDLL_MAKEDLL
# define SIMPLEDLL_EXPORT Q_DECL_EXPORT
#else
# define SIMPLEDLL_EXPORT Q_DECL_IMPORT
#endif
class SIMPLEDLL_EXPORT Simple
{
public:
Simple();

View File

@ -1,7 +1,7 @@
TEMPLATE = lib
CONFIG += dll
win32:DEFINES += SIMPLEDLL_MAKEDLL
DEFINES += SIMPLEDLL_MAKEDLL
HEADERS = simple.h
SOURCES = simple.cpp
@ -10,5 +10,5 @@ VERSION = 1.0.0
INCLUDEPATH += . tmp
MOC_DIR = tmp
OBJECTS_DIR = tmp
TARGET = simple_dll
DESTDIR = ./
TARGET = "simple dll"
DESTDIR = "dest dir"

View File

@ -1,6 +1,6 @@
TEMPLATE = subdirs
SUBDIRS = simple_app \
simple_dll
SUBDIRS = simple_dll \
simple_app
CONFIG += ordered

View File

@ -141,14 +141,15 @@ void tst_qmake::cleanup()
void tst_qmake::simple_app()
{
QString workDir = base_path + "/testdata/simple_app";
QString destDir = workDir + "/dest dir";
QVERIFY( test_compiler.qmake( workDir, "simple_app" ));
QVERIFY( test_compiler.make( workDir ));
QVERIFY( test_compiler.exists( workDir, "simple_app", Exe, "1.0.0" ));
QVERIFY( test_compiler.exists( destDir, "simple app", Exe, "1.0.0" ));
QVERIFY( test_compiler.makeClean( workDir ));
QVERIFY( test_compiler.exists( workDir, "simple_app", Exe, "1.0.0" )); // Should still exist after a make clean
QVERIFY( test_compiler.exists( destDir, "simple app", Exe, "1.0.0" )); // Should still exist after a make clean
QVERIFY( test_compiler.makeDistClean( workDir ));
QVERIFY( !test_compiler.exists( workDir, "simple_app", Exe, "1.0.0" )); // Should not exist after a make distclean
QVERIFY( !test_compiler.exists( destDir, "simple app", Exe, "1.0.0" )); // Should not exist after a make distclean
QVERIFY( test_compiler.removeMakefile( workDir ) );
}
@ -156,14 +157,15 @@ void tst_qmake::simple_app_shadowbuild()
{
QString workDir = base_path + "/testdata/simple_app";
QString buildDir = base_path + "/testdata/simple_app_build";
QString destDir = buildDir + "/dest dir";
QVERIFY( test_compiler.qmake( workDir, "simple_app", buildDir ));
QVERIFY( test_compiler.make( buildDir ));
QVERIFY( test_compiler.exists( buildDir, "simple_app", Exe, "1.0.0" ));
QVERIFY( test_compiler.exists( destDir, "simple app", Exe, "1.0.0" ));
QVERIFY( test_compiler.makeClean( buildDir ));
QVERIFY( test_compiler.exists( buildDir, "simple_app", Exe, "1.0.0" )); // Should still exist after a make clean
QVERIFY( test_compiler.exists( destDir, "simple app", Exe, "1.0.0" )); // Should still exist after a make clean
QVERIFY( test_compiler.makeDistClean( buildDir ));
QVERIFY( !test_compiler.exists( buildDir, "simple_app", Exe, "1.0.0" )); // Should not exist after a make distclean
QVERIFY( !test_compiler.exists( destDir, "simple app", Exe, "1.0.0" )); // Should not exist after a make distclean
QVERIFY( test_compiler.removeMakefile( buildDir ) );
}
@ -171,46 +173,49 @@ void tst_qmake::simple_app_shadowbuild2()
{
QString workDir = base_path + "/testdata/simple_app";
QString buildDir = base_path + "/testdata/simple_app/build";
QString destDir = buildDir + "/dest dir";
QVERIFY( test_compiler.qmake( workDir, "simple_app", buildDir ));
QVERIFY( test_compiler.make( buildDir ));
QVERIFY( test_compiler.exists( buildDir, "simple_app", Exe, "1.0.0" ));
QVERIFY( test_compiler.exists( destDir, "simple app", Exe, "1.0.0" ));
QVERIFY( test_compiler.makeClean( buildDir ));
QVERIFY( test_compiler.exists( buildDir, "simple_app", Exe, "1.0.0" )); // Should still exist after a make clean
QVERIFY( test_compiler.exists( destDir, "simple app", Exe, "1.0.0" )); // Should still exist after a make clean
QVERIFY( test_compiler.makeDistClean( buildDir ));
QVERIFY( !test_compiler.exists( buildDir, "simple_app", Exe, "1.0.0" )); // Should not exist after a make distclean
QVERIFY( !test_compiler.exists( destDir, "simple app", Exe, "1.0.0" )); // Should not exist after a make distclean
QVERIFY( test_compiler.removeMakefile( buildDir ) );
}
void tst_qmake::simple_dll()
{
QString workDir = base_path + "/testdata/simple_dll";
QString destDir = workDir + "/dest dir";
QDir D;
D.remove( workDir + "/Makefile");
QVERIFY( test_compiler.qmake( workDir, "simple_dll" ));
QVERIFY( test_compiler.make( workDir ));
QVERIFY( test_compiler.exists( workDir, "simple_dll", Dll, "1.0.0" ));
QVERIFY( test_compiler.exists( destDir, "simple dll", Dll, "1.0.0" ));
QVERIFY( test_compiler.makeClean( workDir ));
QVERIFY( test_compiler.exists( workDir, "simple_dll", Dll, "1.0.0" )); // Should still exist after a make clean
QVERIFY( test_compiler.exists( destDir, "simple dll", Dll, "1.0.0" )); // Should still exist after a make clean
QVERIFY( test_compiler.makeDistClean( workDir ));
QVERIFY( !test_compiler.exists( workDir, "simple_dll", Dll, "1.0.0" )); // Should not exist after a make distclean
QVERIFY( !test_compiler.exists( destDir, "simple dll", Dll, "1.0.0" )); // Should not exist after a make distclean
QVERIFY( test_compiler.removeMakefile( workDir ) );
}
void tst_qmake::simple_lib()
{
QString workDir = base_path + "/testdata/simple_lib";
QString destDir = workDir + "/dest dir";
QDir D;
D.remove( workDir + "/Makefile");
QVERIFY( test_compiler.qmake( workDir, "simple_lib" ));
QVERIFY( test_compiler.make( workDir ));
QVERIFY( test_compiler.exists( workDir, "simple_lib", Lib, "1.0.0" ));
QVERIFY( test_compiler.exists( destDir, "simple lib", Lib, "1.0.0" ));
QVERIFY( test_compiler.makeClean( workDir ));
QVERIFY( test_compiler.exists( workDir, "simple_lib", Lib, "1.0.0" )); // Should still exist after a make clean
QVERIFY( test_compiler.exists( destDir, "simple lib", Lib, "1.0.0" )); // Should still exist after a make clean
QVERIFY( test_compiler.makeDistClean( workDir ));
QVERIFY( !test_compiler.exists( workDir, "simple_lib", Lib, "1.0.0" )); // Should not exist after a make distclean
QVERIFY( !test_compiler.exists( destDir, "simple lib", Lib, "1.0.0" )); // Should not exist after a make distclean
QVERIFY( test_compiler.removeMakefile( workDir ) );
}
@ -223,12 +228,12 @@ void tst_qmake::subdirs()
D.remove( workDir + "/simple_dll/Makefile");
QVERIFY( test_compiler.qmake( workDir, "subdirs" ));
QVERIFY( test_compiler.make( workDir ));
QVERIFY( test_compiler.exists( workDir + "/simple_app", "simple_app", Exe, "1.0.0" ));
QVERIFY( test_compiler.exists( workDir + "/simple_dll", "simple_dll", Dll, "1.0.0" ));
QVERIFY( test_compiler.exists( workDir + "/simple_app/dest dir", "simple app", Exe, "1.0.0" ));
QVERIFY( test_compiler.exists( workDir + "/simple_dll/dest dir", "simple dll", Dll, "1.0.0" ));
QVERIFY( test_compiler.makeClean( workDir ));
// Should still exist after a make clean
QVERIFY( test_compiler.exists( workDir + "/simple_app", "simple_app", Exe, "1.0.0" ));
QVERIFY( test_compiler.exists( workDir + "/simple_dll", "simple_dll", Dll, "1.0.0" ));
QVERIFY( test_compiler.exists( workDir + "/simple_app/dest dir", "simple app", Exe, "1.0.0" ));
QVERIFY( test_compiler.exists( workDir + "/simple_dll/dest dir", "simple dll", Dll, "1.0.0" ));
// Since subdirs templates do not have a make dist clean, we should clean up ourselves
// properly
QVERIFY( test_compiler.makeDistClean( workDir ));