summaryrefslogtreecommitdiffstats
path: root/tests/auto/qmake
diff options
context:
space:
mode:
authorOswald Buddenhagen <oswald.buddenhagen@nokia.com>2010-07-06 19:39:52 +0200
committerOswald Buddenhagen <oswald.buddenhagen@nokia.com>2010-07-07 11:46:24 +0200
commitb139e7e96e5c47b412c4f0bbc4ae11d5cca99e61 (patch)
tree93c36e980ddac04e2aef8f0223f9aca84a205236 /tests/auto/qmake
parent047dd2d73fab867187d17f684be464233f64165b (diff)
run dep commands in build dir
the file names are given relative to the build directory, so the command needs to be run in it as well. this is a more expected (and simpler) fix than the alternative, which would be giving file names relative to the source directory. reasons not to fix: - due to some other bug, the problem really affects only builds where the build dir is not at the same level as the source dir - otherwise, absolute paths would be passed anyway - it has some breakage potential for the cases where the commands actually expect being run in the source dir - it can be worked around by manually injecting the cd statement into the command reasons why i still fixed it: - it doesn't affect in-source builds, and it seems that most complex build systems (which would define custom compilers with depend_command) don't support shadow builds anyway - people who needed things to work probably already used $$OUT_PWD somehow (either a "cd" at the start, or prepending it to each path), so this change will be practically a no-op - "it's just dependencies, and these are known to be broken in qmake anyway" Reviewed-by: joerg Task-number: QTBUG-1918
Diffstat (limited to 'tests/auto/qmake')
-rw-r--r--tests/auto/qmake/testdata/simple_app/build/README1
-rw-r--r--tests/auto/qmake/testdata/simple_app/simple_app.pro1
-rw-r--r--tests/auto/qmake/testdata/simple_app/test.qrc5
-rw-r--r--tests/auto/qmake/tst_qmake.cpp16
4 files changed, 23 insertions, 0 deletions
diff --git a/tests/auto/qmake/testdata/simple_app/build/README b/tests/auto/qmake/testdata/simple_app/build/README
new file mode 100644
index 0000000000..acfd9d9226
--- /dev/null
+++ b/tests/auto/qmake/testdata/simple_app/build/README
@@ -0,0 +1 @@
+Here to ensure build/ exists, used by the simple_app_shadowbuild2 test.
diff --git a/tests/auto/qmake/testdata/simple_app/simple_app.pro b/tests/auto/qmake/testdata/simple_app/simple_app.pro
index f496d5bb8e..a8c4ad613d 100644
--- a/tests/auto/qmake/testdata/simple_app/simple_app.pro
+++ b/tests/auto/qmake/testdata/simple_app/simple_app.pro
@@ -3,6 +3,7 @@ CONFIG += qt warn_on
HEADERS = test_file.h
SOURCES = test_file.cpp \
main.cpp
+RESOURCES = test.qrc
TARGET = simple_app
DESTDIR = ./
diff --git a/tests/auto/qmake/testdata/simple_app/test.qrc b/tests/auto/qmake/testdata/simple_app/test.qrc
new file mode 100644
index 0000000000..decde3dd24
--- /dev/null
+++ b/tests/auto/qmake/testdata/simple_app/test.qrc
@@ -0,0 +1,5 @@
+<RCC>
+ <qresource prefix="/">
+ <file>test.qrc</file>
+ </qresource>
+</RCC>
diff --git a/tests/auto/qmake/tst_qmake.cpp b/tests/auto/qmake/tst_qmake.cpp
index 03054e709d..5efe7148db 100644
--- a/tests/auto/qmake/tst_qmake.cpp
+++ b/tests/auto/qmake/tst_qmake.cpp
@@ -65,6 +65,7 @@ public slots:
private slots:
void simple_app();
void simple_app_shadowbuild();
+ void simple_app_shadowbuild2();
void simple_lib();
void simple_dll();
void subdirs();
@@ -163,6 +164,21 @@ void tst_qmake::simple_app_shadowbuild()
QVERIFY( test_compiler.removeMakefile( buildDir ) );
}
+void tst_qmake::simple_app_shadowbuild2()
+{
+ QString workDir = base_path + "/testdata/simple_app";
+ QString buildDir = base_path + "/testdata/simple_app/build";
+
+ 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.makeClean( buildDir ));
+ QVERIFY( test_compiler.exists( buildDir, "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.removeMakefile( buildDir ) );
+}
+
void tst_qmake::simple_dll()
{
QString workDir = base_path + "/testdata/simple_dll";