From a54a8961bad16c55bd0a56896dec42de875cc0b4 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Wed, 6 Jan 2010 12:51:02 +0100 Subject: move equivalent of output_ts test to good/ --- tests/auto/linguist/lupdate/.gitignore | 2 +- .../lupdate/testdata/good/reloutput/lupdatecmd | 2 + .../lupdate/testdata/good/reloutput/main.cpp | 50 ++++++++++++++++++++++ .../lupdate/testdata/good/reloutput/project.pro | 9 ++++ .../good/reloutput/translations/project.ts.result | 12 ++++++ .../linguist/lupdate/testdata/output_ts/lupdatecmd | 1 - .../lupdate/testdata/output_ts/project.ts.result | 12 ------ .../output_ts/toplevel/library/tools/main.cpp | 50 ---------------------- .../output_ts/toplevel/library/tools/tools.pro | 9 ---- .../toplevel/library/tools/translations/readme.txt | 2 - tests/auto/linguist/lupdate/tst_lupdate.cpp | 49 --------------------- 11 files changed, 74 insertions(+), 124 deletions(-) create mode 100644 tests/auto/linguist/lupdate/testdata/good/reloutput/lupdatecmd create mode 100644 tests/auto/linguist/lupdate/testdata/good/reloutput/main.cpp create mode 100644 tests/auto/linguist/lupdate/testdata/good/reloutput/project.pro create mode 100644 tests/auto/linguist/lupdate/testdata/good/reloutput/translations/project.ts.result delete mode 100644 tests/auto/linguist/lupdate/testdata/output_ts/lupdatecmd delete mode 100644 tests/auto/linguist/lupdate/testdata/output_ts/project.ts.result delete mode 100644 tests/auto/linguist/lupdate/testdata/output_ts/toplevel/library/tools/main.cpp delete mode 100644 tests/auto/linguist/lupdate/testdata/output_ts/toplevel/library/tools/tools.pro delete mode 100644 tests/auto/linguist/lupdate/testdata/output_ts/toplevel/library/tools/translations/readme.txt diff --git a/tests/auto/linguist/lupdate/.gitignore b/tests/auto/linguist/lupdate/.gitignore index 4ba5b79..389f2dc 100644 --- a/tests/auto/linguist/lupdate/.gitignore +++ b/tests/auto/linguist/lupdate/.gitignore @@ -1,4 +1,4 @@ tst_lupdate testdata/good/*/project.ts -testdata/output_ts/toplevel/library/tools/translations/project.ts +testdata/good/*/*/project.ts testdata/recursivescan/*.ts diff --git a/tests/auto/linguist/lupdate/testdata/good/reloutput/lupdatecmd b/tests/auto/linguist/lupdate/testdata/good/reloutput/lupdatecmd new file mode 100644 index 0000000..da6103f --- /dev/null +++ b/tests/auto/linguist/lupdate/testdata/good/reloutput/lupdatecmd @@ -0,0 +1,2 @@ +TRANSLATION: translations/project.ts +lupdate project.pro -ts translations/project.ts diff --git a/tests/auto/linguist/lupdate/testdata/good/reloutput/main.cpp b/tests/auto/linguist/lupdate/testdata/good/reloutput/main.cpp new file mode 100644 index 0000000..5a681e2 --- /dev/null +++ b/tests/auto/linguist/lupdate/testdata/good/reloutput/main.cpp @@ -0,0 +1,50 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +// 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"); +} + + diff --git a/tests/auto/linguist/lupdate/testdata/good/reloutput/project.pro b/tests/auto/linguist/lupdate/testdata/good/reloutput/project.pro new file mode 100644 index 0000000..5d263ae --- /dev/null +++ b/tests/auto/linguist/lupdate/testdata/good/reloutput/project.pro @@ -0,0 +1,9 @@ +SOURCES += main.cpp + +TRANSLATIONS = translations/project.ts + +exists( $$TRANSLATIONS ) { + win32: system(del $$TRANSLATIONS) + unix: system(rm -f $$TRANSLATIONS) +} + diff --git a/tests/auto/linguist/lupdate/testdata/good/reloutput/translations/project.ts.result b/tests/auto/linguist/lupdate/testdata/good/reloutput/translations/project.ts.result new file mode 100644 index 0000000..e398701 --- /dev/null +++ b/tests/auto/linguist/lupdate/testdata/good/reloutput/translations/project.ts.result @@ -0,0 +1,12 @@ + + + + + QApplication + + + Hello world + + + + diff --git a/tests/auto/linguist/lupdate/testdata/output_ts/lupdatecmd b/tests/auto/linguist/lupdate/testdata/output_ts/lupdatecmd deleted file mode 100644 index d3a5bf7..0000000 --- a/tests/auto/linguist/lupdate/testdata/output_ts/lupdatecmd +++ /dev/null @@ -1 +0,0 @@ -lupdate toplevel/library/tools/tools.pro diff --git a/tests/auto/linguist/lupdate/testdata/output_ts/project.ts.result b/tests/auto/linguist/lupdate/testdata/output_ts/project.ts.result deleted file mode 100644 index e398701..0000000 --- a/tests/auto/linguist/lupdate/testdata/output_ts/project.ts.result +++ /dev/null @@ -1,12 +0,0 @@ - - - - - QApplication - - - Hello world - - - - diff --git a/tests/auto/linguist/lupdate/testdata/output_ts/toplevel/library/tools/main.cpp b/tests/auto/linguist/lupdate/testdata/output_ts/toplevel/library/tools/main.cpp deleted file mode 100644 index 5a681e2..0000000 --- a/tests/auto/linguist/lupdate/testdata/output_ts/toplevel/library/tools/main.cpp +++ /dev/null @@ -1,50 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the test suite of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -// 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"); -} - - diff --git a/tests/auto/linguist/lupdate/testdata/output_ts/toplevel/library/tools/tools.pro b/tests/auto/linguist/lupdate/testdata/output_ts/toplevel/library/tools/tools.pro deleted file mode 100644 index 5d263ae..0000000 --- a/tests/auto/linguist/lupdate/testdata/output_ts/toplevel/library/tools/tools.pro +++ /dev/null @@ -1,9 +0,0 @@ -SOURCES += main.cpp - -TRANSLATIONS = translations/project.ts - -exists( $$TRANSLATIONS ) { - win32: system(del $$TRANSLATIONS) - unix: system(rm -f $$TRANSLATIONS) -} - diff --git a/tests/auto/linguist/lupdate/testdata/output_ts/toplevel/library/tools/translations/readme.txt b/tests/auto/linguist/lupdate/testdata/output_ts/toplevel/library/tools/translations/readme.txt deleted file mode 100644 index 83adcd2..0000000 --- a/tests/auto/linguist/lupdate/testdata/output_ts/toplevel/library/tools/translations/readme.txt +++ /dev/null @@ -1,2 +0,0 @@ -This is just a dummy file so that GIT creates this folder - diff --git a/tests/auto/linguist/lupdate/tst_lupdate.cpp b/tests/auto/linguist/lupdate/tst_lupdate.cpp index 0442d27..73ede2f 100644 --- a/tests/auto/linguist/lupdate/tst_lupdate.cpp +++ b/tests/auto/linguist/lupdate/tst_lupdate.cpp @@ -60,7 +60,6 @@ public: private slots: void good_data(); void good(); - void output_ts(); void commandline_data(); void commandline(); #if CHECK_SIMTEXTH @@ -216,54 +215,6 @@ void tst_lupdate::good() doCompare(generatedtsfile, expectedFile, false); } -void tst_lupdate::output_ts() -{ - QString dir = m_basePath + "output_ts"; - m_lupdate.setWorkingDirectory(dir); - - // look for a command - QString lupdatecmd; - QFile file(dir + "/lupdatecmd"); - if (file.exists()) { - QVERIFY(file.open(QIODevice::ReadOnly | QIODevice::Text)); - while (!file.atEnd()) { - QByteArray cmdstring = file.readLine().simplified(); - if (cmdstring.startsWith('#')) - continue; - if (cmdstring.startsWith("lupdate")) { - cmdstring.remove(0, 8); - lupdatecmd.append(cmdstring); - break; - } - } - file.close(); - } - - QDir parsingDir(m_basePath + "output_ts"); - - QString generatedtsfile = - dir + QLatin1String("/toplevel/library/tools/translations/project.ts"); - - QFile::remove(generatedtsfile); - - lupdatecmd.prepend("-silent "); - m_lupdate.qmake(); - m_lupdate.updateProFile(lupdatecmd); - - // If the file expectedoutput.txt exists, compare the - // console output with the content of that file - QFile outfile(dir + "/expectedoutput.txt"); - if (outfile.exists()) { - QString errs = m_lupdate.getErrorMessages().at(1).trimmed(); - QStringList errslist = errs.split(QLatin1Char('\n')); - doCompare(errslist, outfile.fileName(), true); - if (QTest::currentTestFailed()) - return; - } - - doCompare(generatedtsfile, dir + QLatin1String("/project.ts.result"), false); -} - void tst_lupdate::commandline_data() { QTest::addColumn("currentPath"); -- cgit v0.12