summaryrefslogtreecommitdiffstats
path: root/tests/auto/linguist/lupdate/testdata/good/merge_ordering
diff options
context:
space:
mode:
authorOswald Buddenhagen <oswald.buddenhagen@nokia.com>2009-06-30 16:17:56 +0200
committerOswald Buddenhagen <oswald.buddenhagen@nokia.com>2009-06-30 17:18:45 +0200
commitcd796aa6dcdf83fa50ced56a9885835fda851a09 (patch)
tree876cbd2764cabcdff820988a1e205547f8be395b /tests/auto/linguist/lupdate/testdata/good/merge_ordering
parent11ee32888b1b2370c70708e1385c26dc3a0a367c (diff)
integrate linguist tool autotests into the qt testsuite
Task-number: 218935
Diffstat (limited to 'tests/auto/linguist/lupdate/testdata/good/merge_ordering')
-rw-r--r--tests/auto/linguist/lupdate/testdata/good/merge_ordering/foo.cpp28
-rw-r--r--tests/auto/linguist/lupdate/testdata/good/merge_ordering/lupdatecmd5
-rw-r--r--tests/auto/linguist/lupdate/testdata/good/merge_ordering/project.pro14
-rw-r--r--tests/auto/linguist/lupdate/testdata/good/merge_ordering/project.ts.before74
-rw-r--r--tests/auto/linguist/lupdate/testdata/good/merge_ordering/project.ts.result82
5 files changed, 203 insertions, 0 deletions
diff --git a/tests/auto/linguist/lupdate/testdata/good/merge_ordering/foo.cpp b/tests/auto/linguist/lupdate/testdata/good/merge_ordering/foo.cpp
new file mode 100644
index 0000000000..af8534dd5e
--- /dev/null
+++ b/tests/auto/linguist/lupdate/testdata/good/merge_ordering/foo.cpp
@@ -0,0 +1,28 @@
+
+// The first line in this file should always be empty, its part of the test!!
+class Foo : public QObject
+{
+ Q_OBJECT
+public:
+ Foo();
+};
+
+Foo::Foo(MainWindow *parent)
+ : QObject(parent)
+{
+ tr("This is the first entry.");
+ tr("A second message."); tr("And a second one on the same line.");
+ tr("This string did move from the bottom.");
+ tr("This tr is new.");
+ tr("This one moved in from another file.");
+ tr("Now again one which is just where it was.");
+
+ tr("Just as this one.");
+ tr("Another alien.");
+ tr("This is from the bottom, too.");
+ tr("Third string from the bottom.");
+ tr("Fourth one!");
+ tr("They are coming!");
+ tr("They are everywhere!");
+ tr("An earthling again.");
+}
diff --git a/tests/auto/linguist/lupdate/testdata/good/merge_ordering/lupdatecmd b/tests/auto/linguist/lupdate/testdata/good/merge_ordering/lupdatecmd
new file mode 100644
index 0000000000..91a480048d
--- /dev/null
+++ b/tests/auto/linguist/lupdate/testdata/good/merge_ordering/lupdatecmd
@@ -0,0 +1,5 @@
+# Add the command that lupdate should run here. If it can't find anything it will default to
+# 'lupdate project.pro -ts project.ts'
+
+# lupdate project.pro
+lupdate -silent -locations relative project.pro
diff --git a/tests/auto/linguist/lupdate/testdata/good/merge_ordering/project.pro b/tests/auto/linguist/lupdate/testdata/good/merge_ordering/project.pro
new file mode 100644
index 0000000000..e79456f9ac
--- /dev/null
+++ b/tests/auto/linguist/lupdate/testdata/good/merge_ordering/project.pro
@@ -0,0 +1,14 @@
+TEMPLATE = app
+LANGUAGE = C++
+
+SOURCES += foo.cpp
+
+TRANSLATIONS = project.ts
+
+# Copy the ts to a temp file because:
+# 1. The depot file is usually read-only
+# 2. We don't want to modify the original file, since then it won't be possible to run the test twice
+# without reverting the original file again.
+
+win32: system(copy /Y project.ts.before $$TRANSLATIONS)
+unix: system(cp -f project.ts.before $$TRANSLATIONS && chmod a+w $$TRANSLATIONS)
diff --git a/tests/auto/linguist/lupdate/testdata/good/merge_ordering/project.ts.before b/tests/auto/linguist/lupdate/testdata/good/merge_ordering/project.ts.before
new file mode 100644
index 0000000000..d70193f9c3
--- /dev/null
+++ b/tests/auto/linguist/lupdate/testdata/good/merge_ordering/project.ts.before
@@ -0,0 +1,74 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS><TS version="2.0">
+<context>
+ <name>Bar</name>
+ <message>
+ <location filename="bar1.cpp" line="13"/>
+ <source>Another alien.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="bar1.cpp" line="14"/>
+ <source>They are coming!</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="bar1.cpp" line="16"/>
+ <source>They are everywhere!</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="bar1.cpp" line="18"/>
+ <source>This one moved in from another file.</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>Foo</name>
+ <message>
+ <location filename="foo1.cpp" line="13"/>
+ <source>This is the first entry.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="foo1.cpp" line="14"/>
+ <source>A second message.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="foo1.cpp" line="15"/>
+ <source>Now again one which is just where it was.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="foo1.cpp" line="16"/>
+ <source>Just as this one.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="foo1.cpp" line="17"/>
+ <source>An earthling again.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="foo1.cpp" line="18"/>
+ <source>This is from the bottom, too.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="foo1.cpp" line="19"/>
+ <source>Third string from the bottom.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="foo1.cpp" line="20"/>
+ <source>Fourth one!</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="foo1.cpp" line="21"/>
+ <source>This string did move from the bottom.</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+</TS>
diff --git a/tests/auto/linguist/lupdate/testdata/good/merge_ordering/project.ts.result b/tests/auto/linguist/lupdate/testdata/good/merge_ordering/project.ts.result
new file mode 100644
index 0000000000..2027efd1f4
--- /dev/null
+++ b/tests/auto/linguist/lupdate/testdata/good/merge_ordering/project.ts.result
@@ -0,0 +1,82 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="2.0">
+<context>
+ <name>Foo</name>
+ <message>
+ <location filename="foo.cpp" line="+13"/>
+ <source>This is the first entry.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>A second message.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location line="+0"/>
+ <source>And a second one on the same line.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location line="+2"/>
+ <source>This tr is new.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>This one moved in from another file.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>Now again one which is just where it was.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location line="+2"/>
+ <source>Just as this one.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>Another alien.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location line="+4"/>
+ <source>They are coming!</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>They are everywhere!</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>An earthling again.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location line="-5"/>
+ <source>This is from the bottom, too.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>Third string from the bottom.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>Fourth one!</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location line="-9"/>
+ <source>This string did move from the bottom.</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+</TS>