Files
qt-creator/share/qtcreator/templates/wizards/autotest/files/tst.qbs
Christian Stenger ae63f89f35 AutoTest: Reduce auto test wizard to useful parts
This patch reduces the former wizard to the test project part.
The wizard appeared more or less useless as there was no easy way
to add test cases later on and you normally do not need to have the
full skeleton of the project including a test sub project - except
when starting a TDD project.

Change-Id: I404d843b29f058876ea9696b7881f2e5e11b6af2
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-03-21 06:17:05 +00:00

50 lines
1.4 KiB
QML

import qbs
@if "%{TestFrameWork}" == "GTest"
import qbs.Environment
import "googlecommon.js" as googleCommon
@endif
CppApplication {
@if "%{TestFrameWork}" == "QtTest"
Depends { name: "Qt.testlib" }
@if "%{RequireGUI}" == "false"
consoleApplication: true
@else
Depends { name: "Qt.gui" }
@endif
files: [
"%{TestCaseFileWithCppSuffix}"
]
@else
consoleApplication: true
@if "%{TestFrameWork}" == "GTest"
property string googletestDir: {
if (typeof Environment.getEnv("GOOGLETEST_DIR") === 'undefined') {
console.warn("Using googletest src dir specified at Qt Creator wizard")
console.log("set GOOGLETEST_DIR as environment variable or Qbs property to get rid of this message")
return "%{GTestRepository}"
} else {
return Environment.getEnv("GOOGLETEST_DIR")
}
}
@endif
@if "%{GTestCXX11}" == "true"
cpp.cxxLanguageVersion: "c++11"
cpp.defines: [ "GTEST_LANG_CXX11" ]
@endif
cpp.dynamicLibraries: [ "pthread" ]
cpp.includePaths: [].concat(googleCommon.getGTestIncludes(googletestDir))
.concat(googleCommon.getGMockIncludes(googletestDir))
files: [
"%{MainCppName}",
"%{TestCaseFileWithHeaderSuffix}",
].concat(googleCommon.getGTestAll(googletestDir))
.concat(googleCommon.getGMockAll(googletestDir))
@endif
}