diff options
author | Jake Petroules <jake.petroules@petroules.com> | 2013-03-13 11:26:05 -0400 |
---|---|---|
committer | Joerg Bornemann <joerg.bornemann@digia.com> | 2013-03-18 07:51:18 +0100 |
commit | 20e1285e150605cdfee9c883f9982f9bd860c965 (patch) | |
tree | 4d8b0044847561989969c7c658bf2ad12a26373d /tests/auto/blackbox/testdata/sameBaseName | |
parent | ff6f0e96164e8cd315fa2fb1ce63e635ed7584d3 (diff) |
Add a new test for the .o filename bugfix.
Task-number: QBS-211
Change-Id: I78e3fd4274a1800265b7ccc7cdc71bb0780f76f2
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
Diffstat (limited to 'tests/auto/blackbox/testdata/sameBaseName')
6 files changed, 75 insertions, 0 deletions
diff --git a/tests/auto/blackbox/testdata/sameBaseName/lib.c b/tests/auto/blackbox/testdata/sameBaseName/lib.c new file mode 100644 index 000000000..6055ed681 --- /dev/null +++ b/tests/auto/blackbox/testdata/sameBaseName/lib.c @@ -0,0 +1,6 @@ +#include <stdio.h> + +extern void printHelloC() +{ + printf("Hello from C in " __FILE__ "\n"); +} diff --git a/tests/auto/blackbox/testdata/sameBaseName/lib.cpp b/tests/auto/blackbox/testdata/sameBaseName/lib.cpp new file mode 100644 index 000000000..933fa8036 --- /dev/null +++ b/tests/auto/blackbox/testdata/sameBaseName/lib.cpp @@ -0,0 +1,6 @@ +#include <iostream> + +extern "C" void printHelloCpp() +{ + std::cout << "Hello from C++ in " << __FILE__ << std::endl; +} diff --git a/tests/auto/blackbox/testdata/sameBaseName/lib.m b/tests/auto/blackbox/testdata/sameBaseName/lib.m new file mode 100644 index 000000000..17cd2dceb --- /dev/null +++ b/tests/auto/blackbox/testdata/sameBaseName/lib.m @@ -0,0 +1,6 @@ +#import <Foundation/Foundation.h> + +extern void printHelloObjc() +{ + NSLog(@"Hello from Objective-C in " __FILE__); +} diff --git a/tests/auto/blackbox/testdata/sameBaseName/lib.mm b/tests/auto/blackbox/testdata/sameBaseName/lib.mm new file mode 100644 index 000000000..ee284b080 --- /dev/null +++ b/tests/auto/blackbox/testdata/sameBaseName/lib.mm @@ -0,0 +1,8 @@ +#include <iostream> +#import <Foundation/Foundation.h> + +extern "C" void printHelloObjcpp() +{ + NSLog(@"Hello from Objective-C++..."); + std::cout << "...in " __FILE__ << std::endl; +} diff --git a/tests/auto/blackbox/testdata/sameBaseName/main.c b/tests/auto/blackbox/testdata/sameBaseName/main.c new file mode 100644 index 000000000..07da20307 --- /dev/null +++ b/tests/auto/blackbox/testdata/sameBaseName/main.c @@ -0,0 +1,18 @@ +extern void printHelloC(); +extern void printHelloCpp(); + +#ifdef __APPLE__ +extern void printHelloObjc(); +extern void printHelloObjcpp(); +#endif + +int main() +{ + printHelloC(); + printHelloCpp(); +#ifdef __APPLE__ + printHelloObjc(); + printHelloObjcpp(); +#endif + return 0; +} diff --git a/tests/auto/blackbox/testdata/sameBaseName/sameBaseName.qbs b/tests/auto/blackbox/testdata/sameBaseName/sameBaseName.qbs new file mode 100644 index 000000000..5dbb52609 --- /dev/null +++ b/tests/auto/blackbox/testdata/sameBaseName/sameBaseName.qbs @@ -0,0 +1,31 @@ +import qbs 1.0 + +Project { + CppApplication { + Depends { name: "basenamelib" } + name: "basename" + files: "main.c" + } + + StaticLibrary { + Depends { name: "cpp" } + name: "basenamelib" + files: [ + "lib.c", + "lib.cpp" + ] + + Group { + condition: qbs.targetOS === "mac" || qbs.targetOS === "ios" + files: [ + "lib.m", + "lib.mm" + ] + } + + ProductModule { + Depends { name: "cpp" } + cpp.frameworks: (qbs.targetOS === "mac" || qbs.targetOS === "ios") ? "Foundation" : undefined + } + } +} |