summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorOswald Buddenhagen <oswald.buddenhagen@nokia.com>2012-06-20 10:34:13 +0200
committerQt by Nokia <qt-info@nokia.com>2012-06-20 12:38:32 +0200
commit6d9c545d2b83305c3c30a0e917e6c3a474dfe66a (patch)
tree54a003c6db32c85f80c5fbb46dbf9322855966e6 /tests
parent86f953a6d40666a3355e76b3ab2c8a2cf5452ec6 (diff)
parentb652bffea7a0a1bf209c21d9b73f509226f031bd (diff)
Merge "Merge branch 'buildsystem'" into refs/staging/master
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/corelib/plugin/qplugin/qplugin.pro4
-rw-r--r--tests/auto/other/macnativeevents/macnativeevents.pro3
-rw-r--r--tests/auto/tools/qmake/testdata/functions/functions.pro61
-rw-r--r--tests/auto/tools/qmake/tst_qmake.cpp3
-rw-r--r--tests/auto/widgets/kernel/qapplication/modal/modal.pro3
-rw-r--r--tests/auto/widgets/kernel/qapplication/wincmdline/wincmdline.pro3
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/qxmlsimplereader.pro3
-rw-r--r--tests/benchmarks/corelib/io/qdiriterator/qdiriterator.pro3
-rw-r--r--tests/benchmarks/corelib/kernel/qvariant/qvariant.pro3
-rw-r--r--tests/benchmarks/gui/animation/qanimation/qanimation.pro3
-rw-r--r--tests/manual/qssloptions/qssloptions.pro3
11 files changed, 66 insertions, 26 deletions
diff --git a/tests/auto/corelib/plugin/qplugin/qplugin.pro b/tests/auto/corelib/plugin/qplugin/qplugin.pro
index 37a12da732..e8840a0fb2 100644
--- a/tests/auto/corelib/plugin/qplugin/qplugin.pro
+++ b/tests/auto/corelib/plugin/qplugin/qplugin.pro
@@ -1,10 +1,10 @@
QT = core
TEMPLATE = subdirs
win32 {
- exists($$[QT_INSTALL_LIBS]/QtCore4.dll) {
+ exists($$[QT_INSTALL_LIBS/get]/QtCore4.dll) {
SUBDIRS = releaseplugin
}
- exists($$[QT_INSTALL_LIBS]/QtCored4.dll) {
+ exists($$[QT_INSTALL_LIBS/get]/QtCored4.dll) {
SUBDIRS += debugplugin
}
}
diff --git a/tests/auto/other/macnativeevents/macnativeevents.pro b/tests/auto/other/macnativeevents/macnativeevents.pro
index 6ec0942222..d72a87f205 100644
--- a/tests/auto/other/macnativeevents/macnativeevents.pro
+++ b/tests/auto/other/macnativeevents/macnativeevents.pro
@@ -1,8 +1,5 @@
CONFIG += testcase
TARGET = tst_macnativeevents
-TEMPLATE = app
-DEPENDPATH += .
-INCLUDEPATH += .
LIBS += -framework Carbon
QT += widgets testlib
HEADERS += qnativeevents.h nativeeventlist.h expectedeventlist.h
diff --git a/tests/auto/tools/qmake/testdata/functions/functions.pro b/tests/auto/tools/qmake/testdata/functions/functions.pro
index ad66ee863d..9ec2ffe93f 100644
--- a/tests/auto/tools/qmake/testdata/functions/functions.pro
+++ b/tests/auto/tools/qmake/testdata/functions/functions.pro
@@ -1,5 +1,9 @@
CONFIG = qt thread
+defineTest(testReplace) {
+ !isEqual(1, $$2):message("FAILED: $$3: got $$1, expected $${2}.")
+}
+
#count
!count( CONFIG, 2 ) {
message( "FAILED: count function: $$CONFIG" )
@@ -84,4 +88,61 @@ myTestFunction("oink baa moo")
message("FAILED: myTestFunction: $$RESULT")
}
+moo = "this is a test" "for real"
+fn = $$OUT_PWD/testdir/afile
+write_file($$fn, moo)|message("FAILED: write_file() failed")
+exists($$fn)|message("FAILED: write_file() didn't write anything")
+mooout = $$cat($$fn, line)
+equals(moo, $$mooout)|message("FAILED: write_file() wrote something wrong")
+moo += "another line"
+write_file($$fn, moo)|message("FAILED: write_file() failed (take 2)")
+mooout = $$cat($$fn, line)
+equals(moo, $$mooout)|message("FAILED: write_file() wrote something wrong (take 2)")
+mooadd = "yet another line"
+write_file($$fn, mooadd, append)|message("FAILED: write_file() failed (append)")
+moo += $$mooadd
+mooout = $$cat($$fn, line)
+equals(moo, $$mooout)|message("FAILED: write_file() wrote something wrong when appending")
+
+pn = $$OUT_PWD/testpath/subdir
+mkpath($$pn)|message("FAILED: mkpath() failed")
+exists($$pn)|message("FAILED: mkpath() didn't create anything")
+
+in = easy "less easy" sca$${LITERAL_HASH}ry crazy$$escape_expand(\\t\\r\\n) $$escape_expand(\\t)shit \'no\"way\\here
+out = "easy \"less easy\" sca\$\${LITERAL_HASH}ry crazy\$\$escape_expand(\\\\t\\\\r\\\\n) \$\$escape_expand(\\\\t)shit \\\'no\\\"way\\\\here"
+testReplace($$val_escape(in), $$out, "val_escape")
+
+testReplace($$shadowed($$PWD/something), $$OUT_PWD/something, "shadowed")
+
+#format_number
+spc = " "
+testReplace($$format_number(13), 13, "simple number format")
+testReplace($$format_number(-13), -13, "negative number format")
+testReplace($$format_number(13, ibase=16), 19, "hex input number format")
+testReplace($$format_number(13, obase=16), d, "hex output number format")
+testReplace($$format_number(13, width=5), " $$spc 13", "right aligned number format")
+testReplace($$format_number(13, width=5 leftalign), "13 $$spc ", "left aligned number format")
+testReplace($$format_number(13, width=5 zeropad), "00013", "zero-padded number format")
+testReplace($$format_number(13, width=5 alwayssign), "$$spc +13", "always signed number format")
+testReplace($$format_number(13, width=5 alwayssign zeropad), "+0013", "zero-padded always signed number format")
+testReplace($$format_number(13, width=5 padsign), " $$spc 13", "sign-padded number format")
+testReplace($$format_number(13, width=5 padsign zeropad), " 0013", "zero-padded sign-padded number format")
+
+testReplace($$clean_path("c:$${DIR_SEPARATOR}crazy//path/../trolls"), "c:/crazy/trolls", "clean_path")
+
+testReplace($$native_path("/crazy/trolls"), "$${DIR_SEPARATOR}crazy$${DIR_SEPARATOR}trolls", "native_path")
+
+testReplace($$absolute_path("crazy/trolls"), "$$PWD/crazy/trolls", "absolute_path")
+testReplace($$absolute_path("crazy/trolls", "/fake/path"), "/fake/path/crazy/trolls", "absolute_path with base")
+testReplace($$relative_path($$_PRO_FILE_PWD_), $$basename($$_PRO_FILE_), "relative_path")
+testReplace($$relative_path("/fake/trolls", "/fake/path"), "../trolls", "relative_path with base")
+
+#this test is very rudimentary. the backend function is thoroughly tested in qt creator
+in = "some nasty\" path\\"
+win32: \
+ out = "\"some nasty\"\\^\"\" path\"\\"
+else: \
+ out = "'some nasty\" path\\'"
+testReplace($$shell_quote($$in), $$out, "shell_quote")
+testReplace($$reverse($$list(one two three)), three two one, "reverse")
diff --git a/tests/auto/tools/qmake/tst_qmake.cpp b/tests/auto/tools/qmake/tst_qmake.cpp
index 88ff10a764..1cdf0d7c7e 100644
--- a/tests/auto/tools/qmake/tst_qmake.cpp
+++ b/tests/auto/tools/qmake/tst_qmake.cpp
@@ -250,7 +250,8 @@ void tst_qmake::subdir_via_pro_file_extra_target()
void tst_qmake::functions()
{
QString workDir = base_path + "/testdata/functions";
- QVERIFY( test_compiler.qmake( workDir, "functions" ));
+ QString buildDir = base_path + "/testdata/functions_build";
+ QVERIFY( test_compiler.qmake( workDir, "functions", buildDir ));
}
void tst_qmake::operators()
diff --git a/tests/auto/widgets/kernel/qapplication/modal/modal.pro b/tests/auto/widgets/kernel/qapplication/modal/modal.pro
index d9489928ba..05e5a7ada7 100644
--- a/tests/auto/widgets/kernel/qapplication/modal/modal.pro
+++ b/tests/auto/widgets/kernel/qapplication/modal/modal.pro
@@ -1,7 +1,4 @@
-TEMPLATE = app
QT += widgets
-DEPENDPATH += .
-INCLUDEPATH += .
SOURCES += main.cpp \
base.cpp
DESTDIR = ./
diff --git a/tests/auto/widgets/kernel/qapplication/wincmdline/wincmdline.pro b/tests/auto/widgets/kernel/qapplication/wincmdline/wincmdline.pro
index 8498d8b31d..3c3b2d0767 100644
--- a/tests/auto/widgets/kernel/qapplication/wincmdline/wincmdline.pro
+++ b/tests/auto/widgets/kernel/qapplication/wincmdline/wincmdline.pro
@@ -1,6 +1,3 @@
-TEMPLATE = app
-DEPENDPATH += .
-INCLUDEPATH += .
QT += widgets
SOURCES += main.cpp
DESTDIR = ./
diff --git a/tests/auto/xml/sax/qxmlsimplereader/qxmlsimplereader.pro b/tests/auto/xml/sax/qxmlsimplereader/qxmlsimplereader.pro
index dc579ab742..20559cec64 100644
--- a/tests/auto/xml/sax/qxmlsimplereader/qxmlsimplereader.pro
+++ b/tests/auto/xml/sax/qxmlsimplereader/qxmlsimplereader.pro
@@ -1,8 +1,7 @@
CONFIG += testcase
TARGET = tst_qxmlsimplereader
-TEMPLATE = app
DEPENDPATH += parser
-INCLUDEPATH += . parser
+INCLUDEPATH += parser
HEADERS += parser/parser.h
SOURCES += tst_qxmlsimplereader.cpp parser/parser.cpp
diff --git a/tests/benchmarks/corelib/io/qdiriterator/qdiriterator.pro b/tests/benchmarks/corelib/io/qdiriterator/qdiriterator.pro
index af3be799c6..3cfb0b44de 100644
--- a/tests/benchmarks/corelib/io/qdiriterator/qdiriterator.pro
+++ b/tests/benchmarks/corelib/io/qdiriterator/qdiriterator.pro
@@ -1,7 +1,4 @@
-TEMPLATE = app
TARGET = tst_bench_qdiriterator
-DEPENDPATH += .
-INCLUDEPATH += .
QT = core testlib
diff --git a/tests/benchmarks/corelib/kernel/qvariant/qvariant.pro b/tests/benchmarks/corelib/kernel/qvariant/qvariant.pro
index 12d131f262..8ea7200d53 100644
--- a/tests/benchmarks/corelib/kernel/qvariant/qvariant.pro
+++ b/tests/benchmarks/corelib/kernel/qvariant/qvariant.pro
@@ -1,7 +1,4 @@
-TEMPLATE = app
TARGET = tst_bench_qvariant
-DEPENDPATH += .
-INCLUDEPATH += .
QT += testlib
CONFIG += release
diff --git a/tests/benchmarks/gui/animation/qanimation/qanimation.pro b/tests/benchmarks/gui/animation/qanimation/qanimation.pro
index d72e3c87d9..a5859468f7 100644
--- a/tests/benchmarks/gui/animation/qanimation/qanimation.pro
+++ b/tests/benchmarks/gui/animation/qanimation/qanimation.pro
@@ -1,9 +1,6 @@
QT += widgets testlib
-TEMPLATE = app
TARGET = tst_bench_qanimation
-DEPENDPATH += .
-INCLUDEPATH += .
CONFIG += release
#CONFIG += debug
diff --git a/tests/manual/qssloptions/qssloptions.pro b/tests/manual/qssloptions/qssloptions.pro
index 3fcb696cd0..55d6dd049b 100644
--- a/tests/manual/qssloptions/qssloptions.pro
+++ b/tests/manual/qssloptions/qssloptions.pro
@@ -1,8 +1,5 @@
CONFIG += testcase
-TEMPLATE = app
TARGET = tst_qssloptions
-DEPENDPATH += .
-INCLUDEPATH += .
QT -= gui
QT += network testlib