summaryrefslogtreecommitdiffstats
path: root/tests/auto/tools
diff options
context:
space:
mode:
authorOswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>2016-05-13 15:58:20 +0200
committerOswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>2016-05-25 06:19:00 +0000
commit22f3800cac47b1b3d10474e8489ddb83cffd4b1e (patch)
tree0ae38c20ff9036f10b6e3b0c846fa560da8f6223 /tests/auto/tools
parentd3cc25ef52d0b2b7ba1cb06609f7c205ee19c2d6 (diff)
add $$str_size() function
this is strlen(), but the name is matched to $$size(), just namespaced to reflect that it operates on a string value rather than a list variable. [ChangeLog][qmake] Added $$str_size() function. Change-Id: I56c8b863da244e66bd283257a66b197aa73b0e57 Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
Diffstat (limited to 'tests/auto/tools')
-rw-r--r--tests/auto/tools/qmakelib/evaltest.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/auto/tools/qmakelib/evaltest.cpp b/tests/auto/tools/qmakelib/evaltest.cpp
index a516f91070..f12b11261a 100644
--- a/tests/auto/tools/qmakelib/evaltest.cpp
+++ b/tests/auto/tools/qmakelib/evaltest.cpp
@@ -826,6 +826,18 @@ void tst_qmakelib::addReplaceFunctions(const QString &qindir)
<< "##:1: size(var) requires one argument."
<< true;
+ QTest::newRow("$$str_size()")
+ << "VAR = $$str_size(one two three)"
+ << "VAR = 13"
+ << ""
+ << true;
+
+ QTest::newRow("$$str_size(): bad number of arguments")
+ << "VAR = $$str_size(1, 2)"
+ << "VAR ="
+ << "##:1: str_size(str) requires one argument."
+ << true;
+
QTest::newRow("$$fromfile(): right var")
<< "VAR = $$fromfile(" + qindir + "/fromfile/infile.prx, DEFINES)"
<< "VAR = QT_DLL"