diff options
author | Christian Kandeler <christian.kandeler@qt.io> | 2017-04-21 09:57:19 +0200 |
---|---|---|
committer | Christian Kandeler <christian.kandeler@qt.io> | 2017-04-28 11:08:05 +0000 |
commit | b4aa71223c18599302d600b079e20fc0fb51009a (patch) | |
tree | 70243969c32958fe89489cb45948599c2a1309eb /tests | |
parent | 9503948fd9195f0d07456e66e4dbf7c781f82ef8 (diff) | |
download | qbs-b4aa71223c18599302d600b079e20fc0fb51009a.tar.gz |
Support command files in cpp.{static,dynamic}Libraries
We will make use of that in a follow-up patch.
Change-Id: I1fb6ca0938bbcc6f53bd0046761023a1b8563949
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/blackbox/testdata/command-file/command-file.qbs | 17 | ||||
-rw-r--r-- | tests/auto/blackbox/testdata/command-file/lib.cpp | 1 | ||||
-rw-r--r-- | tests/auto/blackbox/testdata/command-file/list.gcc | 1 | ||||
-rw-r--r-- | tests/auto/blackbox/testdata/command-file/list.msvc | 1 | ||||
-rw-r--r-- | tests/auto/blackbox/testdata/command-file/main.cpp | 6 | ||||
-rw-r--r-- | tests/auto/blackbox/tst_blackbox.cpp | 9 | ||||
-rw-r--r-- | tests/auto/blackbox/tst_blackbox.h | 1 |
7 files changed, 36 insertions, 0 deletions
diff --git a/tests/auto/blackbox/testdata/command-file/command-file.qbs b/tests/auto/blackbox/testdata/command-file/command-file.qbs new file mode 100644 index 000000000..09823b152 --- /dev/null +++ b/tests/auto/blackbox/testdata/command-file/command-file.qbs @@ -0,0 +1,17 @@ +import qbs + +Project { + StaticLibrary { + name: "theLib" + destinationDirectory: project.buildDirectory + Depends { name: "cpp" } + files: ["lib.cpp"] + } + CppApplication { + name: "theApp" + cpp.libraryPaths: project.buildDirectory + files: ["main.cpp"] + cpp.staticLibraries: ['@' + sourceDirectory + '/' + + (qbs.toolchain.contains("msvc") ? "list.msvc" : "list.gcc")] + } +} diff --git a/tests/auto/blackbox/testdata/command-file/lib.cpp b/tests/auto/blackbox/testdata/command-file/lib.cpp new file mode 100644 index 000000000..8101b05dc --- /dev/null +++ b/tests/auto/blackbox/testdata/command-file/lib.cpp @@ -0,0 +1 @@ +void f() { } diff --git a/tests/auto/blackbox/testdata/command-file/list.gcc b/tests/auto/blackbox/testdata/command-file/list.gcc new file mode 100644 index 000000000..2bb6dae62 --- /dev/null +++ b/tests/auto/blackbox/testdata/command-file/list.gcc @@ -0,0 +1 @@ +-ltheLib diff --git a/tests/auto/blackbox/testdata/command-file/list.msvc b/tests/auto/blackbox/testdata/command-file/list.msvc new file mode 100644 index 000000000..6f7a50ca2 --- /dev/null +++ b/tests/auto/blackbox/testdata/command-file/list.msvc @@ -0,0 +1 @@ +theLib.lib diff --git a/tests/auto/blackbox/testdata/command-file/main.cpp b/tests/auto/blackbox/testdata/command-file/main.cpp new file mode 100644 index 000000000..6a0bac9f1 --- /dev/null +++ b/tests/auto/blackbox/testdata/command-file/main.cpp @@ -0,0 +1,6 @@ +void f(); + +int main() +{ + f(); +} diff --git a/tests/auto/blackbox/tst_blackbox.cpp b/tests/auto/blackbox/tst_blackbox.cpp index e541bacc8..84d490999 100644 --- a/tests/auto/blackbox/tst_blackbox.cpp +++ b/tests/auto/blackbox/tst_blackbox.cpp @@ -3043,6 +3043,15 @@ void TestBlackbox::combinedSources() QVERIFY(m_qbsStdout.contains("compiling amalgamated_theapp.cpp")); } +void TestBlackbox::commandFile() +{ + QDir::setCurrent(testDataDir + "/command-file"); + QbsRunParameters params(QStringList() << "-p" << "theLib"); + QCOMPARE(runQbs(params), 0); + params.arguments = QStringList() << "-p" << "theApp"; + QCOMPARE(runQbs(params), 0); +} + void TestBlackbox::jsExtensionsFile() { QDir::setCurrent(testDataDir + "/jsextensions-file"); diff --git a/tests/auto/blackbox/tst_blackbox.h b/tests/auto/blackbox/tst_blackbox.h index 7a4a0cb67..c73855696 100644 --- a/tests/auto/blackbox/tst_blackbox.h +++ b/tests/auto/blackbox/tst_blackbox.h @@ -59,6 +59,7 @@ private slots: void cli(); void combinedMoc(); void combinedSources(); + void commandFile(); void concurrentExecutor(); void conditionalExport(); void conditionalFileTagger(); |