diff options
author | Christian Kandeler <christian.kandeler@digia.com> | 2012-10-15 16:46:58 +0200 |
---|---|---|
committer | Joerg Bornemann <joerg.bornemann@digia.com> | 2012-10-16 09:18:59 +0200 |
commit | f9316555115173d4ad76b8c9da2138ba6b998428 (patch) | |
tree | e410d54b2c5a371fc81702275d7f3b56fef2b1a1 /tests/auto/tools/tst_tools.cpp | |
parent | dee5d4d3d7f9d0740e5e58d7517ffec0c5602900 (diff) |
Clean up main().
- Modularize: Move implementations of all top-level commands into their
own functions.
- Move a couple of checks to places where they belong better.
- Remove graph dumping functionality.
As a result, the code flow is now much more obvious.
Change-Id: I571e07965d10c3b79da4c40e977c95e5626e8a5d
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
Diffstat (limited to 'tests/auto/tools/tst_tools.cpp')
-rw-r--r-- | tests/auto/tools/tst_tools.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/tests/auto/tools/tst_tools.cpp b/tests/auto/tools/tst_tools.cpp index 8c92f377b..4c3bf3506 100644 --- a/tests/auto/tools/tst_tools.cpp +++ b/tests/auto/tools/tst_tools.cpp @@ -27,8 +27,8 @@ ** ****************************************************************************/ -#include <tools/logger.h> #include <tools/fileinfo.h> +#include <tools/logger.h> #include <tools/options.h> #include <QDir> #include <QtTest> @@ -44,6 +44,7 @@ private slots: args.append("-v"); args << "--products" << "blubb"; args << "--changed-files" << "foo,bar"; + args << "-h"; qbs::CommandLineOptions options; QVERIFY(options.parseCommandLine(args)); QCOMPARE(qbs::Logger::instance().level(), qbs::LoggerTrace); @@ -51,13 +52,13 @@ private slots: QCOMPARE(options.buildOptions().selectedProductNames, QStringList() << "blubb"); QCOMPARE(options.buildOptions().changedFiles.count(), 2); QVERIFY(options.buildOptions().keepGoing); - QVERIFY(options.parseCommandLine(QStringList() << "-vvvqqq")); + QVERIFY(options.parseCommandLine(QStringList() << "-vvvqqqh")); QCOMPARE(qbs::Logger::instance().level(), qbs::Logger::defaultLevel()); - QVERIFY(options.parseCommandLine(QStringList() << "-vvqqq")); + QVERIFY(options.parseCommandLine(QStringList() << "-vvqqqh")); QCOMPARE(qbs::Logger::instance().level(), qbs::LoggerWarning); - QVERIFY(options.parseCommandLine(QStringList() << "-vvvqq")); + QVERIFY(options.parseCommandLine(QStringList() << "-vvvqqh")); QCOMPARE(qbs::Logger::instance().level(), qbs::LoggerDebug); - QVERIFY(options.parseCommandLine(QStringList() << "--log-level" << "trace")); + QVERIFY(options.parseCommandLine(QStringList() << "--log-level" << "trace" << "-h")); QCOMPARE(qbs::Logger::instance().level(), qbs::LoggerTrace); } |