aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/app/qbs/parser/parser.pri2
-rw-r--r--src/app/qbs/qbs.pro1
-rw-r--r--tests/auto/auto.pri9
-rw-r--r--tests/auto/auto.pro2
-rw-r--r--tests/auto/blackbox/blackbox.pro18
-rw-r--r--tests/auto/buildgraph/buildgraph.pro14
-rw-r--r--tests/auto/cmdlineparser/cmdlineparser.pro14
-rw-r--r--tests/auto/dependencyFinder/dependencyFinder.pro10
-rw-r--r--tests/auto/dependencyFinder/order_basic1.qbs4
-rw-r--r--tests/auto/dependencyFinder/order_basic2.qbs5
-rw-r--r--tests/auto/dependencyFinder/order_complex1.qbs8
-rw-r--r--tests/auto/dependencyFinder/order_nodeps.qbs4
-rw-r--r--tests/auto/dependencyFinder/test1.qbs16
-rw-r--r--tests/auto/dependencyFinder/tst_dependencyFinder.cpp561
-rw-r--r--tests/auto/language/language.pro13
-rw-r--r--tests/auto/tools/tools.pro16
16 files changed, 23 insertions, 674 deletions
diff --git a/src/app/qbs/parser/parser.pri b/src/app/qbs/parser/parser.pri
index 44f97db67..a45c7b3c1 100644
--- a/src/app/qbs/parser/parser.pri
+++ b/src/app/qbs/parser/parser.pri
@@ -12,3 +12,5 @@ HEADERS += \
$$PWD/commandlineoption.h \
$$PWD/commandlineoptionpool.h \
$$PWD/commandtype.h
+
+include(../../../../qbs_version.pri)
diff --git a/src/app/qbs/qbs.pro b/src/app/qbs/qbs.pro
index 1b5865993..b90815c56 100644
--- a/src/app/qbs/qbs.pro
+++ b/src/app/qbs/qbs.pro
@@ -26,6 +26,5 @@ HEADERS += \
../shared/qbssettings.h
include(../../lib/use.pri)
-include(../../../qbs_version.pri)
include(parser/parser.pri)
include(../shared/logging/logging.pri)
diff --git a/tests/auto/auto.pri b/tests/auto/auto.pri
new file mode 100644
index 000000000..295353899
--- /dev/null
+++ b/tests/auto/auto.pri
@@ -0,0 +1,9 @@
+TEMPLATE = app
+DESTDIR = ../../../bin
+DEFINES += SRCDIR=\\\"$$_PRO_FILE_PWD_/\\\"
+
+QT = core script testlib
+CONFIG += depend_includepath testcase console
+CONFIG -= app_bundle
+
+include(../../src/lib/use.pri)
diff --git a/tests/auto/auto.pro b/tests/auto/auto.pro
index e21764a88..cb9058681 100644
--- a/tests/auto/auto.pro
+++ b/tests/auto/auto.pro
@@ -1,6 +1,6 @@
TEMPLATE=subdirs
CONFIG += ordered
-SUBDIRS= \
+SUBDIRS = \
buildgraph \
cmdlineparser \
language \
diff --git a/tests/auto/blackbox/blackbox.pro b/tests/auto/blackbox/blackbox.pro
index 391221ada..1c8e97e63 100644
--- a/tests/auto/blackbox/blackbox.pro
+++ b/tests/auto/blackbox/blackbox.pro
@@ -1,18 +1,6 @@
-TEMPLATE = app
TARGET = tst_blackbox
-DESTDIR = ../../../bin
-INCLUDEPATH += ../../../src/lib/
-DEFINES += SRCDIR=\\\"$$PWD/\\\"
-QT = core script testlib
-CONFIG += depend_includepath testcase
-CONFIG += console
-CONFIG -= app_bundle
+HEADERS = tst_blackbox.h
+SOURCES = tst_blackbox.cpp
-include(../../../src/lib/use.pri)
-
-HEADERS += \
- tst_blackbox.h
-
-SOURCES += \
- tst_blackbox.cpp
+include(../auto.pri)
diff --git a/tests/auto/buildgraph/buildgraph.pro b/tests/auto/buildgraph/buildgraph.pro
index b86d36b6e..4388aac1e 100644
--- a/tests/auto/buildgraph/buildgraph.pro
+++ b/tests/auto/buildgraph/buildgraph.pro
@@ -1,16 +1,6 @@
-TEMPLATE = app
TARGET = tst_buildgraph
-DESTDIR = ../../../bin
-INCLUDEPATH += ../../../src/lib/
-DEFINES += SRCDIR=\\\"$$PWD/\\\"
-QT = core testlib
-CONFIG += depend_includepath testcase
-CONFIG += console
-CONFIG -= app_bundle
+SOURCES = tst_buildgraph.cpp
-SOURCES += \
- tst_buildgraph.cpp
-
-include(../../../src/lib/use.pri)
+include(../auto.pri)
include(../../../src/app/shared/logging/logging.pri)
diff --git a/tests/auto/cmdlineparser/cmdlineparser.pro b/tests/auto/cmdlineparser/cmdlineparser.pro
index 069bf34fb..a95676be5 100644
--- a/tests/auto/cmdlineparser/cmdlineparser.pro
+++ b/tests/auto/cmdlineparser/cmdlineparser.pro
@@ -1,17 +1,7 @@
-TEMPLATE = app
TARGET = tst_cmdlineparser
-DESTDIR = ../../../bin
-INCLUDEPATH += ../../../src/lib/
-DEFINES += SRCDIR=\\\"$$PWD/\\\"
-QT = core testlib
-CONFIG += depend_includepath testcase
-CONFIG += console
-CONFIG -= app_bundle
+SOURCES = tst_cmdlineparser.cpp ../../../src/app/qbs/qbstool.cpp
-SOURCES += tst_cmdlineparser.cpp ../../../src/app/qbs/qbstool.cpp
-
-include(../../../src/lib/use.pri)
-include(../../../qbs_version.pri)
+include(../auto.pri)
include(../../../src/app/qbs/parser/parser.pri)
include(../../../src/app/shared/logging/logging.pri)
diff --git a/tests/auto/dependencyFinder/dependencyFinder.pro b/tests/auto/dependencyFinder/dependencyFinder.pro
deleted file mode 100644
index 7ecd2cbe4..000000000
--- a/tests/auto/dependencyFinder/dependencyFinder.pro
+++ /dev/null
@@ -1,10 +0,0 @@
-TEMPLATE = app
-TARGET = testDependencyFinder
-DEPENDPATH += .
-INCLUDEPATH += . ../../../src/lib/
-DEFINES += SRCDIR=\\\"$$PWD/\\\"
-
-QT = core script testlib
-
-SOURCES += \
- tst_dependencyFinder.cpp
diff --git a/tests/auto/dependencyFinder/order_basic1.qbs b/tests/auto/dependencyFinder/order_basic1.qbs
deleted file mode 100644
index 5a8529b80..000000000
--- a/tests/auto/dependencyFinder/order_basic1.qbs
+++ /dev/null
@@ -1,4 +0,0 @@
-Project {
- foo: bar
- bar: 2
-}
diff --git a/tests/auto/dependencyFinder/order_basic2.qbs b/tests/auto/dependencyFinder/order_basic2.qbs
deleted file mode 100644
index 8c0979870..000000000
--- a/tests/auto/dependencyFinder/order_basic2.qbs
+++ /dev/null
@@ -1,5 +0,0 @@
-Project {
- bar: car
- foo: bar
- car: 1
-}
diff --git a/tests/auto/dependencyFinder/order_complex1.qbs b/tests/auto/dependencyFinder/order_complex1.qbs
deleted file mode 100644
index aba10cacf..000000000
--- a/tests/auto/dependencyFinder/order_complex1.qbs
+++ /dev/null
@@ -1,8 +0,0 @@
-Project {
- bar: car + foo + def
- foo: def
- car: foo + abc + blub
- abc: foo + blub
- def: 12 + blub
- blub: 24
-}
diff --git a/tests/auto/dependencyFinder/order_nodeps.qbs b/tests/auto/dependencyFinder/order_nodeps.qbs
deleted file mode 100644
index 54cecaf19..000000000
--- a/tests/auto/dependencyFinder/order_nodeps.qbs
+++ /dev/null
@@ -1,4 +0,0 @@
-Project {
- foo: 1
- bar: 2
-}
diff --git a/tests/auto/dependencyFinder/test1.qbs b/tests/auto/dependencyFinder/test1.qbs
deleted file mode 100644
index dd0e11325..000000000
--- a/tests/auto/dependencyFinder/test1.qbs
+++ /dev/null
@@ -1,16 +0,0 @@
-Module {
- includePaths: foo + abc.def
- foo: bar
-
- car: {
- var x = 12
- x = 13
- var aaa = function aa(x1, x2) {
- function bbb() { bbb() }
- x = x1 + x2 + x2.def
- aa(x1, x2)
- bbb();
- }
- return aaa(x, includePaths)
- }
-}
diff --git a/tests/auto/dependencyFinder/tst_dependencyFinder.cpp b/tests/auto/dependencyFinder/tst_dependencyFinder.cpp
deleted file mode 100644
index b26476ff1..000000000
--- a/tests/auto/dependencyFinder/tst_dependencyFinder.cpp
+++ /dev/null
@@ -1,561 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of the Qt Build Suite.
-**
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
-**
-** 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, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-****************************************************************************/
-
-#include <QtTest/QtTest>
-#include <QtScript/QScriptEngine>
-#include <QtScript/QScriptProgram>
-
-using namespace QmlJS::AST;
-
-class Function
-{
-public:
- QString name;
- QString code;
-};
-
-class Property
-{
-public:
- QString name;
- QString code;
- QList<QStringList> dependencies;
- QList<QStringList> sideEffects;
-};
-
-class Object
-{
-public:
- QString prototype;
- QList<Object> objects;
- QHash<QString, Property> properties;
- QHash<QString, Function> functions;
-};
-
-template <typename T>
-static QString textOf(const QString &source, T *node)
-{
- return source.mid(node->firstSourceLocation().begin(), node->lastSourceLocation().end() - node->firstSourceLocation().begin());
-}
-
-static QList<QStringList> stripLocals(const QList<QStringList> &deps, const QStringList &locals)
-{
- QList<QStringList> result;
- foreach (const QStringList &dep, deps) {
- if (!locals.contains(dep.first()))
- result.append(dep);
- }
- return result;
-}
-
-// run on a statement/expression to find its deps and side effect targets
-class DependencyFinder : protected QmlJS::AST::Visitor
-{
-public:
- DependencyFinder();
-
- void operator()(Node *node)
- {
- m_deps.clear();
- m_sideEffects.clear();
- m_locals.clear();
- Node::accept(node, this);
- m_deps = stripLocals(m_deps, m_locals);
- m_sideEffects = stripLocals(m_sideEffects, m_locals);
- }
-
- QList<QStringList> dependencies() const
- {
- return m_deps;
- }
-
- QList<QStringList> sideEffects() const
- {
- return m_sideEffects;
- }
-
-protected:
- using Visitor::visit;
-
- // local vars, not external deps
- bool visit(VariableDeclaration *ast);
- bool visit(FunctionDeclaration *ast);
- bool visit(FunctionExpression *ast);
-
- // deps
- bool visit(IdentifierExpression *ast);
- bool visit(FieldMemberExpression *ast);
- bool visit(ArrayMemberExpression *ast);
-
- // side effects
- bool visit(BinaryExpression *ast);
- bool visit(PreIncrementExpression *ast);
- bool visit(PostIncrementExpression *ast);
- bool visit(PreDecrementExpression *ast);
- bool visit(PostDecrementExpression *ast);
-
- void sideEffectOn(ExpressionNode *ast);
-
-private:
- QList<QSOperator::Op> m_assigningOps;
-
- QStringList m_locals;
- QList<QStringList> m_deps;
- QList<QStringList> m_sideEffects;
-};
-
-DependencyFinder::DependencyFinder()
-{
- m_assigningOps << QSOperator::Assign
- << QSOperator::InplaceAnd
- << QSOperator::InplaceSub
- << QSOperator::InplaceDiv
- << QSOperator::InplaceAdd
- << QSOperator::InplaceLeftShift
- << QSOperator::InplaceMod
- << QSOperator::InplaceMul
- << QSOperator::InplaceOr
- << QSOperator::InplaceRightShift
- << QSOperator::InplaceURightShift
- << QSOperator::InplaceXor;
-}
-
-bool DependencyFinder::visit(VariableDeclaration *ast)
-{
- if (ast->name)
- m_locals.append(ast->name->asString());
- return true;
-}
-
-bool DependencyFinder::visit(FunctionDeclaration *ast)
-{
- if (ast->name)
- m_locals.append(ast->name->asString());
- return visit(static_cast<FunctionExpression *>(ast));
-}
-
-bool DependencyFinder::visit(FunctionExpression *ast)
-{
- const QStringList outerLocals = m_locals;
- m_locals.clear();
- m_locals += QLatin1String("arguments");
- if (ast->name)
- m_locals += ast->name->asString();
- for (FormalParameterList *it = ast->formals; it; it = it->next) {
- if (it->name)
- m_locals += it->name->asString();
- }
-
- const QList<QStringList> outerDeps = m_deps;
- const QList<QStringList> outerSideEffects = m_sideEffects;
- m_deps.clear();
- m_sideEffects.clear();
-
- Node::accept(ast->body, this);
-
- m_deps = stripLocals(m_deps, m_locals);
- m_deps += outerDeps;
-
- m_sideEffects = stripLocals(m_sideEffects, m_locals);
- m_sideEffects += outerSideEffects;
-
- m_locals = outerLocals;
- return false;
-}
-
-bool DependencyFinder::visit(IdentifierExpression *ast)
-{
- if (ast->name)
- m_deps += QStringList() << ast->name->asString();
- return true;
-}
-
-class GetMemberAccess : protected Visitor
-{
- QStringList m_result;
-
-public:
- // gets the longest static member access, i.e.
- // foo.bar["abc"] -> foo,bar,abc
- // foo.bar[aaa].def -> foo.bar
- QStringList operator()(ExpressionNode *ast)
- {
- m_result.clear();
- Node::accept(ast, this);
- return m_result;
- }
-
-protected:
- bool preVisit(Node *ast)
- {
- if (cast<FieldMemberExpression *>(ast)
- || cast<ArrayMemberExpression *>(ast)
- || cast<IdentifierExpression *>(ast))
- return true;
- m_result.clear();
- return false;
- }
-
- bool visit(FieldMemberExpression *ast)
- {
- if (ast->name) {
- m_result.prepend(ast->name->asString());
- return true;
- }
- m_result.clear();
- return true;
- }
-
- bool visit(ArrayMemberExpression *ast)
- {
- if (StringLiteral *string = cast<StringLiteral *>(ast->expression)) {
- m_result.prepend(string->value->asString());
- return true;
- }
- m_result.clear();
- return true;
- }
-
- bool visit(IdentifierExpression *ast)
- {
- if (ast->name) {
- m_result.prepend(ast->name->asString());
- return true;
- }
- m_result.clear();
- return true;
- }
-};
-
-bool DependencyFinder::visit(FieldMemberExpression *ast)
-{
- const QStringList dep = GetMemberAccess()(ast);
- if (!dep.isEmpty())
- m_deps += dep;
- return false;
-}
-
-bool DependencyFinder::visit(ArrayMemberExpression *ast)
-{
- const QStringList dep = GetMemberAccess()(ast);
- if (!dep.isEmpty())
- m_deps += dep;
- return false;
-}
-
-void DependencyFinder::sideEffectOn(ExpressionNode *ast)
-{
- QStringList assignee = GetMemberAccess()(ast);
- if (!assignee.isEmpty())
- m_sideEffects += assignee;
- // ### does this catch everything?
-}
-
-bool DependencyFinder::visit(BinaryExpression *ast)
-{
- if (!m_assigningOps.contains(static_cast<QSOperator::Op>(ast->op)))
- return true;
-
- sideEffectOn(ast->left);
-
- // need to collect dependencies regardless, consider a = b = c = d
- return true;
-}
-
-bool DependencyFinder::visit(PreDecrementExpression *ast)
-{
- sideEffectOn(ast->expression);
- return true;
-}
-
-bool DependencyFinder::visit(PostDecrementExpression *ast)
-{
- sideEffectOn(ast->base);
- return true;
-}
-
-bool DependencyFinder::visit(PreIncrementExpression *ast)
-{
- sideEffectOn(ast->expression);
- return true;
-}
-
-bool DependencyFinder::visit(PostIncrementExpression *ast)
-{
- sideEffectOn(ast->base);
- return true;
-}
-
-static QHash<QString, Function> bindFunctions(const QString &source, UiObjectInitializer *ast)
-{
- QHash<QString, Function> result;
- for (UiObjectMemberList *it = ast->members; it; it = it->next) {
- UiSourceElement *sourceElement = cast<UiSourceElement *>(it->member);
- if (!sourceElement)
- continue;
- FunctionDeclaration *fdecl = cast<FunctionDeclaration *>(sourceElement->sourceElement);
- if (!fdecl)
- continue;
-
- Function f;
- if (!fdecl->name)
- throw Exception("function decl without name");
- f.name = fdecl->name->asString();
- f.code = textOf(source, fdecl);
- result.insert(f.name, f);
- }
- return result;
-}
-
-static QHash<QString, Property> bindProperties(const QString &source, UiObjectInitializer *ast)
-{
- QHash<QString, Property> result;
- for (UiObjectMemberList *it = ast->members; it; it = it->next) {
- if (UiScriptBinding *scriptBinding = cast<UiScriptBinding *>(it->member)) {
- Property p;
- if (!scriptBinding->qualifiedId || !scriptBinding->qualifiedId->name || scriptBinding->qualifiedId->next)
- throw Exception("script binding without name or name with dots");
- p.name = scriptBinding->qualifiedId->name->asString();
- p.code = textOf(source, scriptBinding->statement);
- DependencyFinder finder;
- finder(scriptBinding->statement);
- p.dependencies = finder.dependencies();
- p.sideEffects = finder.sideEffects();
- result.insert(p.name, p);
- }
- }
- return result;
-}
-
-static Object bindObject(const QString &source, UiObjectDefinition *ast);
-
-static QList<Object> bindObjects(const QString &source, UiObjectInitializer *ast)
-{
- QList<Object> result;
- for (UiObjectMemberList *it = ast->members; it; it = it->next) {
- if (UiObjectDefinition *objDef = cast<UiObjectDefinition *>(it->member)) {
- result += bindObject(source, objDef);
- }
- }
- return result;
-}
-
-static Object bindObject(const QString &source, UiObjectDefinition *ast)
-{
- Object result;
-
- if (!ast->qualifiedTypeNameId || !ast->qualifiedTypeNameId->name || ast->qualifiedTypeNameId->next)
- throw Exception("no prototype or prototype with dots");
- result.prototype = ast->qualifiedTypeNameId->name->asString();
-
- result.functions = bindFunctions(source, ast->initializer);
- result.properties = bindProperties(source, ast->initializer);
- result.objects = bindObjects(source, ast->initializer);
-
- return result;
-}
-
-
-class Loader
-{
-public:
- Object readFile(const QString &fileName)
- {
- Object emptyReturn;
-
- QFile file(fileName);
- if (!file.open(QFile::ReadOnly)) {
- qWarning() << "Couldn't open" << fileName;
- return emptyReturn;
- }
-
- const QString code = QTextStream(&file).readAll();
- QScopedPointer<QmlJS::Engine> engine(new QmlJS::Engine);
- QScopedPointer<QmlJS::NodePool> nodePool(new QmlJS::NodePool(fileName, engine.data()));
- QmlJS::Lexer lexer(engine.data());
- lexer.setCode(code, 1);
- QmlJS::Parser parser(engine.data());
- parser.parse();
- QList<QmlJS::DiagnosticMessage> parserMessages = parser.diagnosticMessages();
- if (!parserMessages.isEmpty()) {
- foreach (const QmlJS::DiagnosticMessage &msg, parserMessages)
- qWarning() << fileName << ":" << msg.loc.startLine << ": " << msg.message;
- return emptyReturn;
- }
-
- // extract dependencies without resolving them
- UiObjectDefinition *rootDef = cast<UiObjectDefinition *>(parser.ast()->members->member);
- if (!rootDef)
- return emptyReturn;
- return bindObject(code, rootDef);
- }
-};
-
-class TestDepFinder : public QObject
-{
- Q_OBJECT
-private slots:
- void test1();
- void evaluationOrder_data();
- void evaluationOrder();
-};
-
-void TestDepFinder::test1()
-{
- Loader loader;
- Object object = loader.readFile(SRCDIR "test1.qbs");
- QCOMPARE(object.properties.size(), 3);
-
- Property includePaths = object.properties.value("includePaths");
- QCOMPARE(includePaths.dependencies.size(), 2);
- QCOMPARE(includePaths.dependencies.at(0), QStringList() << "foo");
- QCOMPARE(includePaths.dependencies.at(1), QStringList() << "abc" << "def");
- QVERIFY(includePaths.sideEffects.isEmpty());
-
- Property foo = object.properties.value("foo");
- QCOMPARE(foo.dependencies.size(), 1);
- QCOMPARE(foo.dependencies.at(0), QStringList() << "bar");
- QVERIFY(foo.sideEffects.isEmpty());
-
- Property car = object.properties.value("car");
- QCOMPARE(car.dependencies.size(), 1);
- QCOMPARE(car.dependencies.at(0), QStringList() << "includePaths");
- QVERIFY(car.sideEffects.isEmpty());
-}
-
-class ResolvedProperty
-{
-public:
- typedef QSharedPointer<ResolvedProperty> Ptr;
- const Object *object;
- const Property *property;
- QList<ResolvedProperty::Ptr> dependencies;
-};
-
-static QList<ResolvedProperty::Ptr> resolveProperties(const Object &object)
-{
- QHash<QString, ResolvedProperty::Ptr> result;
-
- // build initial resolved property list
- foreach (const Property &property, object.properties) {
- ResolvedProperty::Ptr resolvedProperty(new ResolvedProperty);
- resolvedProperty->object = &object;
- resolvedProperty->property = &property;
- result.insert(property.name, resolvedProperty);
- }
-
- // add dependency links
- QHashIterator<QString, ResolvedProperty::Ptr> it(result);
- while (it.hasNext()) {
- it.next();
- ResolvedProperty::Ptr resolvedProperty = it.value();
- foreach (const QStringList &dependency, resolvedProperty->property->dependencies) {
- ResolvedProperty::Ptr rDepProp = result.value(dependency.first());
- // ### TODO This needs serious extension:
- // ### check globals (QScriptEngine), object.functions, parent objects?
- if (!rDepProp) {
- throw Exception(QString("property %1 has dependency on nonexistent property %2").arg(
- it.key(), dependency.first()));
- }
- resolvedProperty->dependencies += rDepProp;
- }
- }
-
- return result.values();
-}
-
-static void resolveDependencies(const ResolvedProperty::Ptr &property,
- QList<ResolvedProperty::Ptr> *target,
- QSet<ResolvedProperty::Ptr> *done,
- QSet<ResolvedProperty::Ptr> *parents)
-{
- if (done->contains(property))
- return;
- parents->insert(property);
- foreach (const ResolvedProperty::Ptr &dep, property->dependencies) {
- if (parents->contains(dep))
- throw Exception("dependency cycle");
- resolveDependencies(dep, target, done, parents);
- }
- target->append(property);
- done->insert(property);
- parents->remove(property);
-}
-
-static QList<ResolvedProperty::Ptr> sortForEvaluation(const QList<ResolvedProperty::Ptr> &input)
-{
- QList<ResolvedProperty::Ptr> result;
- QSet<ResolvedProperty::Ptr> done;
- QSet<ResolvedProperty::Ptr> parents;
-
- foreach (const ResolvedProperty::Ptr &property, input) {
- resolveDependencies(property, &result, &done, &parents);
- }
-
- return result;
-}
-
-void TestDepFinder::evaluationOrder_data()
-{
- QTest::addColumn<QString>("fileName");
- QTest::addColumn<QStringList>("expectedOrder");
- QTest::newRow("no dependencies")
- << QString(SRCDIR "order_nodeps.qbs")
- << (QStringList() << "foo" << "bar");
- QTest::newRow("basic1")
- << QString(SRCDIR "order_basic1.qbs")
- << (QStringList() << "bar" << "foo");
- QTest::newRow("basic2")
- << QString(SRCDIR "order_basic2.qbs")
- << (QStringList() << "car" << "bar" << "foo");
- QTest::newRow("complex1")
- << QString(SRCDIR "order_complex1.qbs")
- << (QStringList() << "blub" << "def" << "foo" << "abc" << "car" << "bar");
-}
-
-void TestDepFinder::evaluationOrder()
-{
- QFETCH(QString, fileName);
- QFETCH(QStringList, expectedOrder);
-
- Loader loader;
- Object object = loader.readFile(fileName);
- QCOMPARE(object.properties.size(), expectedOrder.size());
-
- QList<ResolvedProperty::Ptr> resolvedProperties = resolveProperties(object);
- QList<ResolvedProperty::Ptr> evaluationOrder = sortForEvaluation(resolvedProperties);
-
- for (int i = 0; i < evaluationOrder.size(); ++i) {
- QCOMPARE(evaluationOrder[i]->property->name, expectedOrder[i]);
- }
-}
-
-QTEST_MAIN(TestDepFinder)
-
-#include "tst_dependencyFinder.moc"
diff --git a/tests/auto/language/language.pro b/tests/auto/language/language.pro
index 06212a2a6..f52798e71 100644
--- a/tests/auto/language/language.pro
+++ b/tests/auto/language/language.pro
@@ -1,15 +1,6 @@
-TEMPLATE = app
TARGET = tst_language
-DESTDIR = ../../../bin
-INCLUDEPATH += ../../../src/lib/
-QT = core testlib
-CONFIG += depend_includepath testcase
-CONFIG += console
-CONFIG -= app_bundle
+SOURCES = tst_language.cpp
-SOURCES += \
- tst_language.cpp
-
-include(../../../src/lib/use.pri)
+include(../auto.pri)
include(../../../src/app/shared/logging/logging.pri)
diff --git a/tests/auto/tools/tools.pro b/tests/auto/tools/tools.pro
index f4cd99956..0ee10216e 100644
--- a/tests/auto/tools/tools.pro
+++ b/tests/auto/tools/tools.pro
@@ -1,17 +1,5 @@
-TEMPLATE = app
TARGET = tst_tools
-DESTDIR = ../../../bin
-INCLUDEPATH += ../../../src/lib/
-DEFINES += SRCDIR=\\\"$$PWD/\\\"
-QT = core testlib
-CONFIG += depend_includepath testcase
-CONFIG += console
-CONFIG -= app_bundle
+SOURCES = tst_tools.cpp ../../../src/app/qbs/qbstool.cpp
-SOURCES += tst_tools.cpp ../../../src/app/qbs/qbstool.cpp
-
-include(../../../src/lib/use.pri)
-include(../../../qbs_version.pri)
-include(../../../src/app/qbs/parser/parser.pri)
-include(../../../src/app/shared/logging/logging.pri)
+include(../auto.pri)