diff options
Diffstat (limited to 'tests/auto/blackbox/testdata-baremetal')
4 files changed, 73 insertions, 0 deletions
diff --git a/tests/auto/blackbox/testdata-baremetal/compiler-defines-by-language/app.c b/tests/auto/blackbox/testdata-baremetal/compiler-defines-by-language/app.c new file mode 100644 index 000000000..58fe69254 --- /dev/null +++ b/tests/auto/blackbox/testdata-baremetal/compiler-defines-by-language/app.c @@ -0,0 +1,4 @@ +int main(void) +{ + return 0; +} diff --git a/tests/auto/blackbox/testdata-baremetal/compiler-defines-by-language/compiler-defines-by-language.qbs b/tests/auto/blackbox/testdata-baremetal/compiler-defines-by-language/compiler-defines-by-language.qbs new file mode 100644 index 000000000..5e8bbd62d --- /dev/null +++ b/tests/auto/blackbox/testdata-baremetal/compiler-defines-by-language/compiler-defines-by-language.qbs @@ -0,0 +1,69 @@ +import "../BareMetalApplication.qbs" as BareMetalApplication + +Project { + property bool supportsCpp: { + if (qbs.toolchain.contains("sdcc")) + return false; + if (qbs.toolchain.contains("keil")) { + if (qbs.architecture === "mcs51" + || qbs.architecture === "mcs251" + || qbs.architecture === "c166") { + return false; + } + } + return true; + } + + BareMetalApplication { + name: "c_language" + files: ["app.c", "ctest.c"] + cpp.enableCompilerDefinesByLanguage: [] + property var foo: { + if (!cpp.compilerDefinesByLanguage) + throw "ASSERT cpp.compilerDefinesByLanguage: " + + cpp.compilerDefinesByLanguage; + if (!cpp.compilerDefinesByLanguage["c"]) + throw "ASSERT cpp.compilerDefinesByLanguage[\"c\"]: " + + cpp.compilerDefinesByLanguage["c"]; + if (cpp.compilerDefinesByLanguage["cpp"]) + throw "ASSERT !cpp.compilerDefinesByLanguage[\"cpp\"]: " + + cpp.compilerDefinesByLanguage["cpp"]; + } + } + + BareMetalApplication { + condition: supportsCpp + name: "cpp_language" + files: ["app.c", "cpptest.cpp"] + cpp.enableCompilerDefinesByLanguage: ["cpp"] + property var foo: { + if (!cpp.compilerDefinesByLanguage) + throw "ASSERT cpp.compilerDefinesByLanguage: " + + cpp.compilerDefinesByLanguage; + if (cpp.compilerDefinesByLanguage["c"]) + throw "ASSERT !cpp.compilerDefinesByLanguage[\"c\"]: " + + cpp.compilerDefinesByLanguage["c"]; + if (!cpp.compilerDefinesByLanguage["cpp"]) + throw "ASSERT cpp.compilerDefinesByLanguage[\"cpp\"]: " + + cpp.compilerDefinesByLanguage["cpp"]; + } + } + + BareMetalApplication { + condition: supportsCpp + name: "c_and_cpp_language" + files: ["app.c", "ctest.c", "cpptest.cpp"] + cpp.enableCompilerDefinesByLanguage: ["c", "cpp"] + property var foo: { + if (!cpp.compilerDefinesByLanguage) + throw "ASSERT cpp.compilerDefinesByLanguage: " + + cpp.compilerDefinesByLanguage; + if (!cpp.compilerDefinesByLanguage["c"]) + throw "ASSERT cpp.compilerDefinesByLanguage[\"c\"]: " + + cpp.compilerDefinesByLanguage["c"]; + if (!cpp.compilerDefinesByLanguage["cpp"]) + throw "ASSERT cpp.compilerDefinesByLanguage[\"cpp\"]: " + + cpp.compilerDefinesByLanguage["cpp"]; + } + } +} diff --git a/tests/auto/blackbox/testdata-baremetal/compiler-defines-by-language/cpptest.cpp b/tests/auto/blackbox/testdata-baremetal/compiler-defines-by-language/cpptest.cpp new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/tests/auto/blackbox/testdata-baremetal/compiler-defines-by-language/cpptest.cpp diff --git a/tests/auto/blackbox/testdata-baremetal/compiler-defines-by-language/ctest.c b/tests/auto/blackbox/testdata-baremetal/compiler-defines-by-language/ctest.c new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/tests/auto/blackbox/testdata-baremetal/compiler-defines-by-language/ctest.c |