From cd796aa6dcdf83fa50ced56a9885835fda851a09 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Tue, 30 Jun 2009 16:17:56 +0200 Subject: integrate linguist tool autotests into the qt testsuite Task-number: 218935 --- .../lupdate/testdata/good/merge_ordering/foo.cpp | 28 ++++++++ .../testdata/good/merge_ordering/lupdatecmd | 5 ++ .../testdata/good/merge_ordering/project.pro | 14 ++++ .../testdata/good/merge_ordering/project.ts.before | 74 +++++++++++++++++++ .../testdata/good/merge_ordering/project.ts.result | 82 ++++++++++++++++++++++ 5 files changed, 203 insertions(+) create mode 100644 tests/auto/linguist/lupdate/testdata/good/merge_ordering/foo.cpp create mode 100644 tests/auto/linguist/lupdate/testdata/good/merge_ordering/lupdatecmd create mode 100644 tests/auto/linguist/lupdate/testdata/good/merge_ordering/project.pro create mode 100644 tests/auto/linguist/lupdate/testdata/good/merge_ordering/project.ts.before create mode 100644 tests/auto/linguist/lupdate/testdata/good/merge_ordering/project.ts.result (limited to 'tests/auto/linguist/lupdate/testdata/good/merge_ordering') 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 @@ + + + + Bar + + + Another alien. + + + + + They are coming! + + + + + They are everywhere! + + + + + This one moved in from another file. + + + + + Foo + + + This is the first entry. + + + + + A second message. + + + + + Now again one which is just where it was. + + + + + Just as this one. + + + + + An earthling again. + + + + + This is from the bottom, too. + + + + + Third string from the bottom. + + + + + Fourth one! + + + + + This string did move from the bottom. + + + + 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 @@ + + + + + Foo + + + This is the first entry. + + + + + A second message. + + + + + And a second one on the same line. + + + + + This tr is new. + + + + + This one moved in from another file. + + + + + Now again one which is just where it was. + + + + + Just as this one. + + + + + Another alien. + + + + + They are coming! + + + + + They are everywhere! + + + + + An earthling again. + + + + + This is from the bottom, too. + + + + + Third string from the bottom. + + + + + Fourth one! + + + + + This string did move from the bottom. + + + + -- cgit v1.2.3