diff options
author | Rohan McGovern <rohan.mcgovern@nokia.com> | 2010-03-03 22:22:27 (GMT) |
---|---|---|
committer | Rohan McGovern <rohan.mcgovern@nokia.com> | 2010-03-03 23:20:01 (GMT) |
commit | 9e5cc0da3cdcf3ddddc35dc78e670994237a180f (patch) | |
tree | 7a1ac34b5e1a276e3c97950b0980247a3def0147 /tests/auto/maketestselftest/tst_maketestselftest.cpp | |
parent | 0489ba37346e4f8efc4a7c1661a60905dc4aa423 (diff) | |
download | Qt-9e5cc0da3cdcf3ddddc35dc78e670994237a180f.zip Qt-9e5cc0da3cdcf3ddddc35dc78e670994237a180f.tar.gz Qt-9e5cc0da3cdcf3ddddc35dc78e670994237a180f.tar.bz2 |
Move tests into separate .pro files, based on Qt module.
Having the tests in separate projects allows for some optimization
strategies when running the tests (e.g. start running corelib tests
while the rest of Qt is still compiling), and allows developers to run
only a subset of tests when appropriate.
Diffstat (limited to 'tests/auto/maketestselftest/tst_maketestselftest.cpp')
-rw-r--r-- | tests/auto/maketestselftest/tst_maketestselftest.cpp | 33 |
1 files changed, 19 insertions, 14 deletions
diff --git a/tests/auto/maketestselftest/tst_maketestselftest.cpp b/tests/auto/maketestselftest/tst_maketestselftest.cpp index 1dde44b..8264e27 100644 --- a/tests/auto/maketestselftest/tst_maketestselftest.cpp +++ b/tests/auto/maketestselftest/tst_maketestselftest.cpp @@ -50,23 +50,27 @@ class tst_MakeTestSelfTest: public QObject Q_OBJECT private slots: - void auto_dot_pro(); - void auto_dot_pro_data(); + void tests_pro_files(); + void tests_pro_files_data(); }; -/* Verify that all tests are listed somewhere in auto.pro */ -void tst_MakeTestSelfTest::auto_dot_pro() +/* Verify that all tests are listed somewhere in one of the autotest .pro files */ +void tst_MakeTestSelfTest::tests_pro_files() { static QStringList lines; if (lines.isEmpty()) { - QString filename = QString::fromLatin1(SRCDIR "/../auto.pro"); - QFile file(filename); - if (!file.open(QIODevice::ReadOnly)) { - QFAIL(qPrintable(QString("open %1: %2").arg(filename).arg(file.errorString()))); - } - while (!file.atEnd()) { - lines << file.readLine().trimmed(); + QDir dir(SRCDIR "/.."); + QStringList proFiles = dir.entryList(QStringList() << "*.pro"); + foreach (QString const& proFile, proFiles) { + QString filename = QString("%1/../%2").arg(SRCDIR).arg(proFile); + QFile file(filename); + if (!file.open(QIODevice::ReadOnly)) { + QFAIL(qPrintable(QString("open %1: %2").arg(filename).arg(file.errorString()))); + } + while (!file.atEnd()) { + lines << file.readLine().trimmed(); + } } } @@ -79,13 +83,14 @@ void tst_MakeTestSelfTest::auto_dot_pro() } QFAIL(qPrintable(QString( - "Subdir `%1' is missing from tests/auto/auto.pro\n" + "Subdir `%1' is missing from tests/auto/*.pro\n" "This means the test won't be compiled or run on any platform.\n" - "If this is intentional, please put the test name in a comment in auto.pro.").arg(subdir)) + "If this is intentional, please put the test name in a comment in one of the .pro files.").arg(subdir)) ); + } -void tst_MakeTestSelfTest::auto_dot_pro_data() +void tst_MakeTestSelfTest::tests_pro_files_data() { QTest::addColumn<QString>("subdir"); QDir dir(SRCDIR "/.."); |