diff options
author | Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com> | 2015-04-17 15:08:21 +0200 |
---|---|---|
committer | Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com> | 2015-05-18 15:49:56 +0000 |
commit | e124ad54b8c1944435e7a26efb109dc0ca3a07e5 (patch) | |
tree | 88fc7dc273071e89b0bf528aaed2361c08fb69be /tests/auto/tools/qmake/tst_qmake.cpp | |
parent | 59840faacfb682a9503c026a6e0357c6ebf97b00 (diff) |
Allow RESOURCES to contain standalone files and collections of files
Standalone files are added by using RESOURCES += file.txt, while
collections of files are defined as collection.files = f1.txt f2.txt
and then added using RESOURCES += collection. For collections a prefix
can also be set using collection.prefix = /foo. The standalone files
are not prefixed.
Change-Id: I8236808238414da05e744f799a1bb15a72f4a46f
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
Diffstat (limited to 'tests/auto/tools/qmake/tst_qmake.cpp')
-rw-r--r-- | tests/auto/tools/qmake/tst_qmake.cpp | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/tests/auto/tools/qmake/tst_qmake.cpp b/tests/auto/tools/qmake/tst_qmake.cpp index 8d7f7bbc68..48c6c0ac84 100644 --- a/tests/auto/tools/qmake/tst_qmake.cpp +++ b/tests/auto/tools/qmake/tst_qmake.cpp @@ -39,6 +39,14 @@ #include <QStandardPaths> #include <QDir> +#if defined(DEBUG_BUILD) +# define DIR_INFIX "debug/" +#elif defined(RELEASE_BUILD) +# define DIR_INFIX "release/" +#else +# define DIR_INFIX "" +#endif + class tst_qmake : public QObject { Q_OBJECT @@ -85,6 +93,7 @@ private slots: void project(); void proFileCache(); void json(); + void resources(); private: TestCompiler test_compiler; @@ -583,5 +592,38 @@ void tst_qmake::json() QVERIFY(output.contains("json.false is false")); } +void tst_qmake::resources() +{ + QString workDir = base_path + "/testdata/resources"; + QVERIFY(test_compiler.qmake(workDir, "resources")); + + { + QFile qrcFile(workDir + "/.rcc/" DIR_INFIX "qmake_pro_file.qrc"); + QVERIFY(qrcFile.exists()); + QVERIFY(qrcFile.open(QFile::ReadOnly)); + QByteArray qrcXml = qrcFile.readAll(); + QVERIFY(qrcXml.contains("alias=\"resources.pro\"")); + QVERIFY(qrcXml.contains("prefix=\"/prefix\"")); + } + + { + QFile qrcFile(workDir + "/.rcc/" DIR_INFIX "qmake_subdir.qrc"); + QVERIFY(qrcFile.exists()); + QVERIFY(qrcFile.open(QFile::ReadOnly)); + QByteArray qrcXml = qrcFile.readAll(); + QVERIFY(qrcXml.contains("alias=\"file.txt\"")); + } + + { + QFile qrcFile(workDir + "/.rcc/" DIR_INFIX "qmake_qmake_immediate.qrc"); + QVERIFY(qrcFile.exists()); + QVERIFY(qrcFile.open(QFile::ReadOnly)); + QByteArray qrcXml = qrcFile.readAll(); + QVERIFY(qrcXml.contains("alias=\"main.cpp\"")); + } + + QVERIFY(test_compiler.make(workDir)); +} + QTEST_MAIN(tst_qmake) #include "tst_qmake.moc" |