From df9a6a9bf9d7bf3609ac034e705d076b82572333 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Tue, 26 Jan 2010 20:16:59 +0100 Subject: absorb cmdline tests into "good" structure --- tests/auto/linguist/lupdate/.gitignore | 1 - .../testdata/good/cmdline_deeppath/lupdatecmd | 2 + .../good/cmdline_deeppath/project.ts.result | 27 +++++ .../testdata/good/cmdline_recurse/lupdatecmd | 2 + .../good/cmdline_recurse/project.ts.result | 115 +++++++++++++++++++++ .../lupdate/testdata/recursivescan/bar.ts.result | 27 ----- .../lupdate/testdata/recursivescan/foo.ts.result | 115 --------------------- tests/auto/linguist/lupdate/tst_lupdate.cpp | 41 -------- 8 files changed, 146 insertions(+), 184 deletions(-) create mode 100644 tests/auto/linguist/lupdate/testdata/good/cmdline_deeppath/lupdatecmd create mode 100644 tests/auto/linguist/lupdate/testdata/good/cmdline_deeppath/project.ts.result create mode 100644 tests/auto/linguist/lupdate/testdata/good/cmdline_recurse/lupdatecmd create mode 100644 tests/auto/linguist/lupdate/testdata/good/cmdline_recurse/project.ts.result delete mode 100644 tests/auto/linguist/lupdate/testdata/recursivescan/bar.ts.result delete mode 100644 tests/auto/linguist/lupdate/testdata/recursivescan/foo.ts.result diff --git a/tests/auto/linguist/lupdate/.gitignore b/tests/auto/linguist/lupdate/.gitignore index 389f2dc..3572c82 100644 --- a/tests/auto/linguist/lupdate/.gitignore +++ b/tests/auto/linguist/lupdate/.gitignore @@ -1,4 +1,3 @@ tst_lupdate testdata/good/*/project.ts testdata/good/*/*/project.ts -testdata/recursivescan/*.ts diff --git a/tests/auto/linguist/lupdate/testdata/good/cmdline_deeppath/lupdatecmd b/tests/auto/linguist/lupdate/testdata/good/cmdline_deeppath/lupdatecmd new file mode 100644 index 0000000..301d839 --- /dev/null +++ b/tests/auto/linguist/lupdate/testdata/good/cmdline_deeppath/lupdatecmd @@ -0,0 +1,2 @@ +cd ../../recursivescan +lupdate sub/finddialog.cpp -ts project.ts diff --git a/tests/auto/linguist/lupdate/testdata/good/cmdline_deeppath/project.ts.result b/tests/auto/linguist/lupdate/testdata/good/cmdline_deeppath/project.ts.result new file mode 100644 index 0000000..5c3c21c --- /dev/null +++ b/tests/auto/linguist/lupdate/testdata/good/cmdline_deeppath/project.ts.result @@ -0,0 +1,27 @@ + + + + + FindDialog + + + Enter the text you want to find. + + + + + Search reached end of the document + + + + + Search reached start of the document + + + + + Text not found + + + + diff --git a/tests/auto/linguist/lupdate/testdata/good/cmdline_recurse/lupdatecmd b/tests/auto/linguist/lupdate/testdata/good/cmdline_recurse/lupdatecmd new file mode 100644 index 0000000..1814e67 --- /dev/null +++ b/tests/auto/linguist/lupdate/testdata/good/cmdline_recurse/lupdatecmd @@ -0,0 +1,2 @@ +cd ../../recursivescan +lupdate . -ts project.ts diff --git a/tests/auto/linguist/lupdate/testdata/good/cmdline_recurse/project.ts.result b/tests/auto/linguist/lupdate/testdata/good/cmdline_recurse/project.ts.result new file mode 100644 index 0000000..95a34fa --- /dev/null +++ b/tests/auto/linguist/lupdate/testdata/good/cmdline_recurse/project.ts.result @@ -0,0 +1,115 @@ + + + + + FindDialog + + + Qt Assistant - Finn text + + + + + Finn tekst + + + + + Enter the text you want to find. + + + + + Search reached end of the document + + + + + Search reached start of the document + + + + + Text not found + + + + + QObject + + + +newline at the start + + + + + newline at the end + + + + + + newline and space at the end + + + + + + space and newline at the end + + + + + + Tab at the start and newline at the end + + + + + + + newline and tab at the start + + + + + space and tab at the start + + + + + space_first + + + + + space_last + + + + + text/c++ + + + test + + + + + text/cpp + + + test + + + + + text/cxx + + + test + + + + diff --git a/tests/auto/linguist/lupdate/testdata/recursivescan/bar.ts.result b/tests/auto/linguist/lupdate/testdata/recursivescan/bar.ts.result deleted file mode 100644 index 5c3c21c..0000000 --- a/tests/auto/linguist/lupdate/testdata/recursivescan/bar.ts.result +++ /dev/null @@ -1,27 +0,0 @@ - - - - - FindDialog - - - Enter the text you want to find. - - - - - Search reached end of the document - - - - - Search reached start of the document - - - - - Text not found - - - - diff --git a/tests/auto/linguist/lupdate/testdata/recursivescan/foo.ts.result b/tests/auto/linguist/lupdate/testdata/recursivescan/foo.ts.result deleted file mode 100644 index 95a34fa..0000000 --- a/tests/auto/linguist/lupdate/testdata/recursivescan/foo.ts.result +++ /dev/null @@ -1,115 +0,0 @@ - - - - - FindDialog - - - Qt Assistant - Finn text - - - - - Finn tekst - - - - - Enter the text you want to find. - - - - - Search reached end of the document - - - - - Search reached start of the document - - - - - Text not found - - - - - QObject - - - -newline at the start - - - - - newline at the end - - - - - - newline and space at the end - - - - - - space and newline at the end - - - - - - Tab at the start and newline at the end - - - - - - - newline and tab at the start - - - - - space and tab at the start - - - - - space_first - - - - - space_last - - - - - text/c++ - - - test - - - - - text/cpp - - - test - - - - - text/cxx - - - test - - - - diff --git a/tests/auto/linguist/lupdate/tst_lupdate.cpp b/tests/auto/linguist/lupdate/tst_lupdate.cpp index b45383f..c179462 100644 --- a/tests/auto/linguist/lupdate/tst_lupdate.cpp +++ b/tests/auto/linguist/lupdate/tst_lupdate.cpp @@ -59,8 +59,6 @@ public: private slots: void good_data(); void good(); - void commandline_data(); - void commandline(); #if CHECK_SIMTEXTH void simtexth(); void simtexth_data(); @@ -313,45 +311,6 @@ void tst_lupdate::good() dir + QLatin1Char('/') + ts + QLatin1String(".result"), false); } -void tst_lupdate::commandline_data() -{ - QTest::addColumn("currentPath"); - QTest::addColumn("commandline"); - QTest::addColumn("generatedtsfile"); - QTest::addColumn("expectedtsfile"); - - QTest::newRow("Recursive scan") << QString("recursivescan") - << QString(". -ts foo.ts") << QString("foo.ts") << QString("foo.ts.result"); - QTest::newRow("Deep path argument") << QString("recursivescan") - << QString("sub/finddialog.cpp -ts bar.ts") << QString("bar.ts") << QString("bar.ts.result"); -} - -void tst_lupdate::commandline() -{ - QFETCH(QString, currentPath); - QFETCH(QString, commandline); - QFETCH(QString, generatedtsfile); - QFETCH(QString, expectedtsfile); - - QString generated = - m_basePath + currentPath + QLatin1Char('/') + generatedtsfile; - QFile gen(generated); - if (gen.exists()) - QVERIFY(gen.remove()); - QProcess proc; - proc.setWorkingDirectory(m_basePath + currentPath); - proc.setProcessChannelMode(QProcess::MergedChannels); - proc.start(m_cmdLupdate + " -silent " + commandline, QIODevice::ReadWrite | QIODevice::Text); - QVERIFY2(proc.waitForFinished(5000), qPrintable(commandline)); - QVERIFY2(proc.exitStatus() == QProcess::NormalExit, - "\"lupdate -silent " + commandline.toLatin1() + "\" crashed\n" + proc.readAll()); - QVERIFY2(!proc.exitCode(), - "\"lupdate -silent " + commandline.toLatin1() + "\" exited with code " + - QByteArray::number(proc.exitCode()) + "\n" + proc.readAll()); - - doCompare(generated, m_basePath + currentPath + QLatin1Char('/') + expectedtsfile, false); -} - #if CHECK_SIMTEXTH void tst_lupdate::simtexth() { -- cgit v0.12