summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorOswald Buddenhagen <oswald.buddenhagen@nokia.com>2009-07-13 16:20:44 +0200
committerOswald Buddenhagen <oswald.buddenhagen@nokia.com>2009-07-13 16:51:21 +0200
commite2f381365bf2158095c5c7236fc4b2f842b9fa8c (patch)
tree5bf317515ed903054c1f2df5bfb41b2356f76273 /tests
parent45efa082135cbf97820a5ce7025685d22bd926ce (diff)
implement proper vpath handling
this also removes the bogus special casing of various filename-containing variables inside the pro parser. while this is a feature as such, it restores backwards compatibility without damaging the correct behavior again, so it qualifies for 4.5. based on a2f40fce2a1cf3c19a13fa27eea08192493ab76e from creator Task-number: 254098
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/linguist/lupdate/testdata/good/proparsingpaths/file1.cpp9
-rw-r--r--tests/auto/linguist/lupdate/testdata/good/proparsingpaths/filter.cpp9
-rw-r--r--tests/auto/linguist/lupdate/testdata/good/proparsingpaths/project.pro10
-rw-r--r--tests/auto/linguist/lupdate/testdata/good/proparsingpaths/project.ts.result31
-rw-r--r--tests/auto/linguist/lupdate/testdata/good/proparsingpaths/sub/sub.pri3
-rw-r--r--tests/auto/linguist/lupdate/testdata/good/proparsingpaths/sub/subfile1.cpp9
-rw-r--r--tests/auto/linguist/lupdate/testdata/good/proparsingpaths/sub/subfilter.cpp9
7 files changed, 80 insertions, 0 deletions
diff --git a/tests/auto/linguist/lupdate/testdata/good/proparsingpaths/file1.cpp b/tests/auto/linguist/lupdate/testdata/good/proparsingpaths/file1.cpp
new file mode 100644
index 0000000000..ad87e70b62
--- /dev/null
+++ b/tests/auto/linguist/lupdate/testdata/good/proparsingpaths/file1.cpp
@@ -0,0 +1,9 @@
+// IMPORTANT!!!! If you want to add testdata to this file,
+// always add it to the end in order to not change the linenumbers of translations!!!
+
+
+void func1() {
+ QApplication::tr("Hello world", "top-level wildcard");
+}
+
+
diff --git a/tests/auto/linguist/lupdate/testdata/good/proparsingpaths/filter.cpp b/tests/auto/linguist/lupdate/testdata/good/proparsingpaths/filter.cpp
new file mode 100644
index 0000000000..912963db70
--- /dev/null
+++ b/tests/auto/linguist/lupdate/testdata/good/proparsingpaths/filter.cpp
@@ -0,0 +1,9 @@
+// IMPORTANT!!!! If you want to add testdata to this file,
+// always add it to the end in order to not change the linenumbers of translations!!!
+
+
+void func1() {
+ QApplication::tr("Hello world", "top-level direct");
+}
+
+
diff --git a/tests/auto/linguist/lupdate/testdata/good/proparsingpaths/project.pro b/tests/auto/linguist/lupdate/testdata/good/proparsingpaths/project.pro
new file mode 100644
index 0000000000..820b4fab04
--- /dev/null
+++ b/tests/auto/linguist/lupdate/testdata/good/proparsingpaths/project.pro
@@ -0,0 +1,10 @@
+SOURCES += file*.cpp filter.cpp non-existing.cpp
+
+include(sub/sub.pri)
+
+TRANSLATIONS = project.ts
+
+exists( $$TRANSLATIONS ) {
+ win32: system(del $$TRANSLATIONS)
+ unix: system(rm -f $$TRANSLATIONS)
+}
diff --git a/tests/auto/linguist/lupdate/testdata/good/proparsingpaths/project.ts.result b/tests/auto/linguist/lupdate/testdata/good/proparsingpaths/project.ts.result
new file mode 100644
index 0000000000..470d6eb7e0
--- /dev/null
+++ b/tests/auto/linguist/lupdate/testdata/good/proparsingpaths/project.ts.result
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="2.0">
+<context>
+ <name>QApplication</name>
+ <message>
+ <location filename="file1.cpp" line="6"/>
+ <source>Hello world</source>
+ <comment>top-level wildcard</comment>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="filter.cpp" line="6"/>
+ <source>Hello world</source>
+ <comment>top-level direct</comment>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="sub/subfile1.cpp" line="6"/>
+ <source>Hello world</source>
+ <comment>nested wildcard</comment>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="sub/subfilter.cpp" line="6"/>
+ <source>Hello world</source>
+ <comment>nested direct</comment>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+</TS>
diff --git a/tests/auto/linguist/lupdate/testdata/good/proparsingpaths/sub/sub.pri b/tests/auto/linguist/lupdate/testdata/good/proparsingpaths/sub/sub.pri
new file mode 100644
index 0000000000..a6079f93ef
--- /dev/null
+++ b/tests/auto/linguist/lupdate/testdata/good/proparsingpaths/sub/sub.pri
@@ -0,0 +1,3 @@
+VPATH += $$PWD
+
+SOURCES += sub/subfile?.cpp subfilter.cpp
diff --git a/tests/auto/linguist/lupdate/testdata/good/proparsingpaths/sub/subfile1.cpp b/tests/auto/linguist/lupdate/testdata/good/proparsingpaths/sub/subfile1.cpp
new file mode 100644
index 0000000000..807d2967db
--- /dev/null
+++ b/tests/auto/linguist/lupdate/testdata/good/proparsingpaths/sub/subfile1.cpp
@@ -0,0 +1,9 @@
+// IMPORTANT!!!! If you want to add testdata to this file,
+// always add it to the end in order to not change the linenumbers of translations!!!
+
+
+void func1() {
+ QApplication::tr("Hello world", "nested wildcard");
+}
+
+
diff --git a/tests/auto/linguist/lupdate/testdata/good/proparsingpaths/sub/subfilter.cpp b/tests/auto/linguist/lupdate/testdata/good/proparsingpaths/sub/subfilter.cpp
new file mode 100644
index 0000000000..6e5dd25c6f
--- /dev/null
+++ b/tests/auto/linguist/lupdate/testdata/good/proparsingpaths/sub/subfilter.cpp
@@ -0,0 +1,9 @@
+// IMPORTANT!!!! If you want to add testdata to this file,
+// always add it to the end in order to not change the linenumbers of translations!!!
+
+
+void func1() {
+ QApplication::tr("Hello world", "nested direct");
+}
+
+