aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tests/auto/blackbox/testdata/sameBaseName/lib.c6
-rw-r--r--tests/auto/blackbox/testdata/sameBaseName/lib.cpp6
-rw-r--r--tests/auto/blackbox/testdata/sameBaseName/lib.m6
-rw-r--r--tests/auto/blackbox/testdata/sameBaseName/lib.mm8
-rw-r--r--tests/auto/blackbox/testdata/sameBaseName/main.c18
-rw-r--r--tests/auto/blackbox/testdata/sameBaseName/sameBaseName.qbs31
-rw-r--r--tests/auto/blackbox/tst_blackbox.cpp3
7 files changed, 78 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
+ }
+ }
+}
diff --git a/tests/auto/blackbox/tst_blackbox.cpp b/tests/auto/blackbox/tst_blackbox.cpp
index bcb281e4f..995be357d 100644
--- a/tests/auto/blackbox/tst_blackbox.cpp
+++ b/tests/auto/blackbox/tst_blackbox.cpp
@@ -192,6 +192,9 @@ void TestBlackbox::build_project_data()
QTest::newRow("app and lib with same source file")
<< QString("lib_samesource")
<< QString(HostOsInfo::appendExecutableSuffix(buildDir + "/HelloWorldApp"));
+ QTest::newRow("source files with the same base name but different extensions")
+ << QString("sameBaseName")
+ << QString(HostOsInfo::appendExecutableSuffix(buildDir + "/basename"));
}
void TestBlackbox::build_project()