diff options
author | Christian Stenger <christian.stenger@qt.io> | 2018-03-09 14:10:57 +0100 |
---|---|---|
committer | Christian Stenger <christian.stenger@qt.io> | 2018-03-09 15:47:57 +0000 |
commit | d90da11f07a07cbb5608deac607ff0c46cc12db8 (patch) | |
tree | 3b132deec0181d69878d41442d41415d1d4bc9c3 /share | |
parent | c25ba91fc13eb6d2903cdd5dab359a5695770e05 (diff) |
AutoTest: Update Qbs/GTest wizard
Instead of using undefined objects pass the needed objects around
to access them inside the JavaScript file.
Also update deprecated function use.
Change-Id: I4c0cafc319047d0b72a0f9310e5335f793f800ac
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Diffstat (limited to 'share')
-rw-r--r-- | share/qtcreator/templates/wizards/autotest/files/googlecommon.js | 22 | ||||
-rw-r--r-- | share/qtcreator/templates/wizards/autotest/files/tst.qbs | 8 |
2 files changed, 15 insertions, 15 deletions
diff --git a/share/qtcreator/templates/wizards/autotest/files/googlecommon.js b/share/qtcreator/templates/wizards/autotest/files/googlecommon.js index 1799b1c242..1079ed5fdf 100644 --- a/share/qtcreator/templates/wizards/autotest/files/googlecommon.js +++ b/share/qtcreator/templates/wizards/autotest/files/googlecommon.js @@ -13,9 +13,9 @@ ** be met: https://www.gnu.org/licenses/gpl-3.0.html. ** **/ -var FileInfo = loadExtension("qbs.FileInfo") +var FileInfo = require("qbs.FileInfo") -function getGTestDir(str) { +function getGTestDir(qbs, str) { if (!str) { if (qbs.hostOS.contains("linux")) return "/usr/include/gtest"; @@ -25,7 +25,7 @@ function getGTestDir(str) { return ""; } -function getGMockDir(str) { +function getGMockDir(qbs, str) { if (!str) { if (qbs.hostOS.contains("linux")) return "/usr/include/gmock"; @@ -35,29 +35,29 @@ function getGMockDir(str) { return ""; } -function getGTestAll(str) { - var gtest = getGTestDir(str); +function getGTestAll(qbs, str) { + var gtest = getGTestDir(qbs, str); if (!gtest) return []; return [FileInfo.joinPaths(gtest, "src/gtest-all.cc")]; } -function getGMockAll(str) { - var gmock = getGMockDir(str); +function getGMockAll(qbs, str) { + var gmock = getGMockDir(qbs, str); if (!gmock) return []; return [FileInfo.joinPaths(gmock, "src/gmock-all.cc")]; } -function getGTestIncludes(str) { - var gtest = getGTestDir(str); +function getGTestIncludes(qbs, str) { + var gtest = getGTestDir(qbs, str); if (!gtest) return []; return [gtest, FileInfo.joinPaths(gtest, "include")]; } -function getGMockIncludes(str) { - var mock = getGMockDir(str); +function getGMockIncludes(qbs, str) { + var mock = getGMockDir(qbs, str); if (!mock) return []; return [mock, FileInfo.joinPaths(mock, "include")]; diff --git a/share/qtcreator/templates/wizards/autotest/files/tst.qbs b/share/qtcreator/templates/wizards/autotest/files/tst.qbs index cb7076a0ac..14d277a429 100644 --- a/share/qtcreator/templates/wizards/autotest/files/tst.qbs +++ b/share/qtcreator/templates/wizards/autotest/files/tst.qbs @@ -43,14 +43,14 @@ CppApplication { } - cpp.includePaths: [].concat(googleCommon.getGTestIncludes(googletestDir)) - .concat(googleCommon.getGMockIncludes(googletestDir)) + cpp.includePaths: [].concat(googleCommon.getGTestIncludes(qbs, googletestDir)) + .concat(googleCommon.getGMockIncludes(qbs, googletestDir)) files: [ "%{MainCppName}", "%{TestCaseFileWithHeaderSuffix}", - ].concat(googleCommon.getGTestAll(googletestDir)) - .concat(googleCommon.getGMockAll(googletestDir)) + ].concat(googleCommon.getGTestAll(qbs, googletestDir)) + .concat(googleCommon.getGMockAll(qbs, googletestDir)) @endif @if "%{TestFrameWork}" == "QtQuickTest" Depends { name: "cpp" } |