diff options
author | Oswald Buddenhagen <oswald.buddenhagen@nokia.com> | 2009-07-13 14:20:44 (GMT) |
---|---|---|
committer | Oswald Buddenhagen <oswald.buddenhagen@nokia.com> | 2009-07-13 14:51:21 (GMT) |
commit | e2f381365bf2158095c5c7236fc4b2f842b9fa8c (patch) | |
tree | 5bf317515ed903054c1f2df5bfb41b2356f76273 /tests/auto | |
parent | 45efa082135cbf97820a5ce7025685d22bd926ce (diff) | |
download | Qt-e2f381365bf2158095c5c7236fc4b2f842b9fa8c.zip Qt-e2f381365bf2158095c5c7236fc4b2f842b9fa8c.tar.gz Qt-e2f381365bf2158095c5c7236fc4b2f842b9fa8c.tar.bz2 |
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/auto')
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 0000000..ad87e70 --- /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 0000000..912963d --- /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 0000000..820b4fa --- /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 0000000..470d6eb --- /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 0000000..a6079f9 --- /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 0000000..807d296 --- /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 0000000..6e5dd25 --- /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"); +} + + |