Commit 698144e3 authored by Christian Kandeler's avatar Christian Kandeler
Browse files

Add qbs project files for autotests.



Note: Since not all autotests are able to run from an installed location,
we need to be able to start them from the build directory, which
in turn forces us to set a destination directory for libraries and plugins,
so they will be found at run-time.

Change-Id: Idcf7e1333dfa6e9dbf745391b78c035f842ccc5a
Reviewed-by: default avatarJoerg Bornemann <joerg.bornemann@digia.com>
parent fbda0ef5
import qbs.base 1.0
Project {
property bool withAutotests: qbs.buildVariant === "debug"
property string ide_version_major: '2'
property string ide_version_minor: '8'
property string ide_version_release: '81'
......@@ -55,5 +56,6 @@ Project {
"lib/qtcreator/qtcomponents/qtcomponents.qbs",
"share/share.qbs",
"share/qtcreator/translations/translations.qbs",
"tests/tests.qbs"
]
}
......@@ -9,6 +9,7 @@ DynamicLibrary {
}
targetName: Defaults.qtLibraryName(qbs, name)
destinationDirectory: project.ide_library_path
cpp.defines: project.generalDefines
cpp.linkerFlags: {
......
......@@ -9,6 +9,7 @@ Product {
property var pluginRecommends: []
targetName: Defaults.qtLibraryName(qbs, name)
destinationDirectory: project.ide_plugin_path + '/' + provider
Depends { name: "ExtensionSystem" }
Depends { name: "pluginspec" }
......
import qbs
import "../autotest.qbs" as Autotest
Autotest {
name: "Aggregation autotest"
Depends { name: "Aggregation" }
files: "tst_aggregate.cpp"
}
import qbs
Project {
name: "Autotests"
condition: project.withAutotests
references: [
"aggregation/aggregation.qbs",
"changeset/changeset.qbs",
"cplusplus/cplusplus.qbs",
"debugger/debugger.qbs",
"diff/diff.qbs",
"environment/environment.qbs",
"extensionsystem/extensionsystem.qbs",
"externaltool/externaltool.qbs",
"filesearch/filesearch.qbs",
"generichighlighter/generichighlighter.qbs",
"ioutils/ioutils.qbs",
"profilewriter/profilewriter.qbs",
"qml/qml.qbs",
"qtcprocess/qtcprocess.qbs",
"treeviewfind/treeviewfind.qbs",
"utils/utils.qbs",
"utils_stringutils/utils_stringutils.qbs",
"valgrind/valgrind.qbs"
]
}
import qbs
import qbs.FileInfo
CppApplication {
type: "application"
Depends { name: "Qt.test" }
targetName: "tst_" + name.split(' ').join("")
// This needs to be absolute, because it is passed to one of the source files.
destinationDirectory: buildDirectory + '/'
+ FileInfo.relativePath(project.ide_source_tree, sourceDirectory)
cpp.rpaths: [
buildDirectory + '/' + project.ide_library_path,
buildDirectory + '/' + project.ide_library_path + "/..", // OSX
buildDirectory + '/' + project.ide_plugin_path + "/QtProject"
]
// The following would be conceptually right, but does not work currently as some autotests
// (e.g. extensionsystem) do not work when installed, because they want hardcoded
// absolute paths to resources in the build directory.
// cpp.rpaths: qbs.targetOS.contains("osx")
// ? ["@executable_path/.."]
// : ["$ORIGIN/../lib/qtcreator", "$ORIGIN/../lib/qtcreator/plugins/QtProject"]
// Group {
// fileTagsFilter: product.type
// qbs.install: true
// qbs.installDir: project.ide_bin_path
// }
}
import qbs
import "../autotest.qbs" as Autotest
Autotest {
name: "ChangeSet autotest"
Depends { name: "Utils" }
Depends { name: "Qt.gui" } // TODO: Remove once qbs bug is fixed.
files: "tst_changeset.cpp"
}
import qbs
import "../cplusplusautotest.qbs" as CPlusPlusAutotest
CPlusPlusAutotest {
name: "CPlusPlus AST autotest"
files: "tst_ast.cpp"
}
import qbs
import "../cplusplusautotest.qbs" as CPlusPlusAutotest
CPlusPlusAutotest {
name: "CPlusPlus check symbols autotest"
files: "tst_checksymbols.cpp"
}
import qbs
import "../cplusplusautotest.qbs" as CPlusPlusAutotest
CPlusPlusAutotest {
name: "CPlusPlus code formatter autotest"
files: "tst_codeformatter.cpp"
}
import qbs
Project {
name: "CPlusPlus autotests"
references: [
"ast/ast.qbs",
"checksymbols/checksymbols.qbs",
"codeformatter/codeformatter.qbs",
"cxx11/cxx11.qbs",
"findusages/findusages.qbs",
"lexer/lexer.qbs",
"lookup/lookup.qbs",
"misc/misc.qbs",
"preprocessor/preprocessor.qbs",
"semantic/semantic.qbs",
"simplifytypes/simplifytypes.qbs",
"typeprettyprinter/typeprettyprinter.qbs"
]
}
import qbs
import "../autotest.qbs" as Autotest
Autotest {
Depends { name: "CppTools" }
Depends { name: "TextEditor" }
Depends { name: "Utils" }
Depends { name: "Qt.widgets" } // For QTextDocument & friends
}
import qbs
import "../cplusplusautotest.qbs" as CPlusPlusAutotest
CPlusPlusAutotest {
name: "Cxx11 autotest"
Group {
name: "Source Files"
files: "tst_cxx11.cpp"
}
Group {
name: "Data Files"
prefix: "data/"
fileTags: ["data"]
files: [
"inlineNamespace.1.cpp",
"inlineNamespace.1.errors.txt",
"staticAssert.1.cpp",
"staticAssert.1.errors.txt",
"noExcept.1.cpp",
"noExcept.1.errors.txt"
]
}
cpp.defines: base.concat(['SRCDIR="' + path + '"'])
}
import qbs
import "../cplusplusautotest.qbs" as CPlusPlusAutotest
CPlusPlusAutotest {
name: "CPlusPlus find usages autotest"
files: "tst_findusages.cpp"
}
import qbs
import "../cplusplusautotest.qbs" as CPlusPlusAutotest
CPlusPlusAutotest {
name: "CPlusPlus lexer autotest"
files: "tst_lexer.cpp"
}
import qbs
import "../cplusplusautotest.qbs" as CPlusPlusAutotest
CPlusPlusAutotest {
name: "CPlusPlus lookup autotest"
files: "tst_lookup.cpp"
}
import qbs
import "../cplusplusautotest.qbs" as CPlusPlusAutotest
CPlusPlusAutotest {
name: "CPlusPlus miscellaneous autotest"
files: "tst_misc.cpp"
}
import qbs
import "../cplusplusautotest.qbs" as CPlusPlusAutotest
CPlusPlusAutotest {
name: "CPlusPlus preprocessor autotest"
Group {
name: "Source Files"
files: "tst_preprocessor.cpp"
}
Group {
name: "Data files"
prefix: "data/"
fileTags: ["data"]
files: [
"empty-macro.cpp", "empty-macro.out.cpp",
"empty-macro.2.cpp", "empty-macro.2.out.cpp",
"identifier-expansion.1.cpp", "identifier-expansion.1.out.cpp",
"identifier-expansion.2.cpp", "identifier-expansion.2.out.cpp",
"identifier-expansion.3.cpp", "identifier-expansion.3.out.cpp",
"identifier-expansion.4.cpp", "identifier-expansion.4.out.cpp",
"identifier-expansion.5.cpp", "identifier-expansion.5.out.cpp",
"macro_expand.c", "macro_expand.out.c",
"macro_expand_1.cpp", "macro_expand_1.out.cpp",
"macro-test.cpp", "macro-test.out.cpp",
"macro_pounder_fn.c",
"noPP.1.cpp",
"noPP.2.cpp",
"poundpound.1.cpp", "poundpound.1.out.cpp",
"recursive.1.cpp", "recursive.1.out.cpp",
"reserved.1.cpp", "reserved.1.out.cpp",
]
}
cpp.defines: base.concat(['SRCDIR="' + path + '"'])
}
import qbs
import "../cplusplusautotest.qbs" as CPlusPlusAutotest
CPlusPlusAutotest {
name: "CPlusPlus semantic autotest"
files: "tst_semantic.cpp"
}
import qbs
import "../cplusplusautotest.qbs" as CPlusPlusAutotest
CPlusPlusAutotest {
name: "CPlusPlus simplify types autotest"
files: "tst_simplifytypestest.cpp"
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment