diff options
author | Jo Asplin <jo.asplin@nokia.com> | 2011-09-12 09:21:12 +0200 |
---|---|---|
committer | Jo Asplin <jo.asplin@nokia.com> | 2011-09-12 10:08:29 +0200 |
commit | 4c43b60323e88befb08504c1ec67305cc8f57e70 (patch) | |
tree | f63216a07d69701e791839d7a9938337792eaf73 /tests/auto/tools/qmake/testdata/functions/functions.pro | |
parent | 3ade4d260f3afe160bd593e27e18f1dffdbee398 (diff) |
Moved autotests in category 'tools' into new directory structure
Task-number: QTBUG-21355
Change-Id: I315d4b1f55d42391524c0e8625952dee1b96fca3
Reviewed-on: http://codereview.qt-project.org/4449
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
Diffstat (limited to 'tests/auto/tools/qmake/testdata/functions/functions.pro')
-rw-r--r-- | tests/auto/tools/qmake/testdata/functions/functions.pro | 87 |
1 files changed, 87 insertions, 0 deletions
diff --git a/tests/auto/tools/qmake/testdata/functions/functions.pro b/tests/auto/tools/qmake/testdata/functions/functions.pro new file mode 100644 index 0000000000..ad66ee863d --- /dev/null +++ b/tests/auto/tools/qmake/testdata/functions/functions.pro @@ -0,0 +1,87 @@ +CONFIG = qt thread + +#count +!count( CONFIG, 2 ) { + message( "FAILED: count function: $$CONFIG" ) +} + +#contains +!contains( CONFIG, thread ) { + message( "FAILED: contains function: $$CONFIG" ) +} + +#exists +!exists( functions.pro ) { + message( "FAILED: exists function" ) +} + +#isEmpty +isEmpty( CONFIG ) { + message( "FAILED: isEmpty function: $CONFIG" ) +} + +#files +!equals($$list($$files(one/*.cpp)), "one/1.cpp one/2.cpp") { + message( "FAILED: files function: one/*.cpp" ) +} +!equals($$list($$files(one/1*.cpp)), "one/1.cpp") { + message( "FAILED: files function: one/1*.cpp" ) +} +!equals($$list($$files(two/*.cpp)), "two/1.cpp two/2.cpp") { + message( "FAILED: files function: two/*.cpp" ) +} +!equals($$list($$files(three/wildcard*.cpp)), "three/wildcard21.cpp three/wildcard22.cpp") { + message( "FAILED: files function: three/wildcard*.cpp" ) +} +!equals($$list($$files(*.cpp)), "1.cpp 2.cpp wildcard21.cpp wildcard22.cpp") { + message( "FAILED: files function: *.cpp" ) +} +!equals($$list($$files(wildcard*.cpp)), "wildcard21.cpp wildcard22.cpp") { + message( "FAILED: files function: wildcard*.cpp" ) +} + +#infile +!infile( infiletest.pro, DEFINES, QT_DLL ){ + message( "FAILED: infile function" ) +} + +#include +include( infiletest.pro, "", true ) +!contains( DEFINES, QT_DLL ) { + message( "FAILED: include function: $$DEFINES" ) +} + +#replace +VERSION=1.0.0 +VERSION_replaced=$$replace(VERSION,\\.,_) +!isEqual(VERSION_replaced, 1_0_0) { + message( "FAILED: replace function: $$VERSION_replaced" ) +} + +#test functions +defineTest(myTestFunction) { + RESULT = + list=$$1 + for(l, list) { + RESULT += $$l + } + export(RESULT) +} +myTestFunction(oink baa moo) +!equals($$list($$member(RESULT, 0)), "oink") { + message("FAILED: myTestFunction: $$RESULT") +} +myTestFunction("oink baa" moo) +!equals($$list($$member(RESULT, 0)), "oink baa") { + message("FAILED: myTestFunction: $$RESULT") +} +myTestFunction(oink "baa moo") +!equals($$list($$member(RESULT, 0)), "oink") { + message("FAILED: myTestFunction: $$RESULT") +} +myTestFunction("oink baa moo") +!equals($$list($$member(RESULT, 0)), "oink baa moo") { + message("FAILED: myTestFunction: $$RESULT") +} + + |