aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tests/auto/blackbox/testdata-baremetal/compiler-listing/compiler-listing.qbs (renamed from tests/auto/blackbox/testdata-baremetal/do-not-generate-compiler-listing/do-not-generate-compiler-listing.qbs)2
-rw-r--r--tests/auto/blackbox/testdata-baremetal/compiler-listing/fun.c (renamed from tests/auto/blackbox/testdata-baremetal/do-not-generate-compiler-listing/fun.c)0
-rw-r--r--tests/auto/blackbox/testdata-baremetal/compiler-listing/main.c (renamed from tests/auto/blackbox/testdata-baremetal/do-not-generate-compiler-listing/main.c)0
-rw-r--r--tests/auto/blackbox/testdata-baremetal/generate-compiler-listing/fun.c4
-rw-r--r--tests/auto/blackbox/testdata-baremetal/generate-compiler-listing/generate-compiler-listing.qbs16
-rw-r--r--tests/auto/blackbox/testdata-baremetal/generate-compiler-listing/main.c6
-rw-r--r--tests/auto/blackbox/tst_blackboxbaremetal.cpp36
7 files changed, 26 insertions, 38 deletions
diff --git a/tests/auto/blackbox/testdata-baremetal/do-not-generate-compiler-listing/do-not-generate-compiler-listing.qbs b/tests/auto/blackbox/testdata-baremetal/compiler-listing/compiler-listing.qbs
index 1bc4ba208..0adfbe37b 100644
--- a/tests/auto/blackbox/testdata-baremetal/do-not-generate-compiler-listing/do-not-generate-compiler-listing.qbs
+++ b/tests/auto/blackbox/testdata-baremetal/compiler-listing/compiler-listing.qbs
@@ -5,12 +5,12 @@ BareMetalApplication {
if (!qbs.toolchain.contains("gcc")) {
if (cpp.compilerName.startsWith("armcc"))
console.info("using short listing file names");
+ console.info("compiler listing suffix: %%" + cpp.compilerListingSuffix + "%%");
return true;
}
console.info("unsupported toolset: %%"
+ qbs.toolchainType + "%%, %%" + qbs.architecture + "%%");
return false;
}
- cpp.generateCompilerListingFiles: false
files: ["main.c", "fun.c"]
}
diff --git a/tests/auto/blackbox/testdata-baremetal/do-not-generate-compiler-listing/fun.c b/tests/auto/blackbox/testdata-baremetal/compiler-listing/fun.c
index 3b8c8f2f4..3b8c8f2f4 100644
--- a/tests/auto/blackbox/testdata-baremetal/do-not-generate-compiler-listing/fun.c
+++ b/tests/auto/blackbox/testdata-baremetal/compiler-listing/fun.c
diff --git a/tests/auto/blackbox/testdata-baremetal/do-not-generate-compiler-listing/main.c b/tests/auto/blackbox/testdata-baremetal/compiler-listing/main.c
index 2c3d7726c..2c3d7726c 100644
--- a/tests/auto/blackbox/testdata-baremetal/do-not-generate-compiler-listing/main.c
+++ b/tests/auto/blackbox/testdata-baremetal/compiler-listing/main.c
diff --git a/tests/auto/blackbox/testdata-baremetal/generate-compiler-listing/fun.c b/tests/auto/blackbox/testdata-baremetal/generate-compiler-listing/fun.c
deleted file mode 100644
index 3b8c8f2f4..000000000
--- a/tests/auto/blackbox/testdata-baremetal/generate-compiler-listing/fun.c
+++ /dev/null
@@ -1,4 +0,0 @@
-int f(void)
-{
- return 0;
-}
diff --git a/tests/auto/blackbox/testdata-baremetal/generate-compiler-listing/generate-compiler-listing.qbs b/tests/auto/blackbox/testdata-baremetal/generate-compiler-listing/generate-compiler-listing.qbs
deleted file mode 100644
index a6731d224..000000000
--- a/tests/auto/blackbox/testdata-baremetal/generate-compiler-listing/generate-compiler-listing.qbs
+++ /dev/null
@@ -1,16 +0,0 @@
-import "../BareMetalApplication.qbs" as BareMetalApplication
-
-BareMetalApplication {
- condition: {
- if (!qbs.toolchain.contains("gcc")) {
- if (cpp.compilerName.startsWith("armcc"))
- console.info("using short listing file names");
- return true;
- }
- console.info("unsupported toolset: %%"
- + qbs.toolchainType + "%%, %%" + qbs.architecture + "%%");
- return false;
- }
- cpp.generateCompilerListingFiles: true
- files: ["main.c", "fun.c"]
-}
diff --git a/tests/auto/blackbox/testdata-baremetal/generate-compiler-listing/main.c b/tests/auto/blackbox/testdata-baremetal/generate-compiler-listing/main.c
deleted file mode 100644
index 2c3d7726c..000000000
--- a/tests/auto/blackbox/testdata-baremetal/generate-compiler-listing/main.c
+++ /dev/null
@@ -1,6 +0,0 @@
-extern int f(void);
-
-int main(void)
-{
- return f();
-}
diff --git a/tests/auto/blackbox/tst_blackboxbaremetal.cpp b/tests/auto/blackbox/tst_blackboxbaremetal.cpp
index 1e300e246..b027a4e70 100644
--- a/tests/auto/blackbox/tst_blackboxbaremetal.cpp
+++ b/tests/auto/blackbox/tst_blackboxbaremetal.cpp
@@ -186,28 +186,42 @@ void TestBlackboxBareMetal::defines()
void TestBlackboxBareMetal::compilerListingFiles_data()
{
- QTest::addColumn<QString>("testPath");
QTest::addColumn<bool>("generateListing");
- QTest::newRow("do-not-generate-compiler-listing") << "/do-not-generate-compiler-listing" << false;
- QTest::newRow("generate-compiler-listing") << "/generate-compiler-listing" << true;
+ QTest::newRow("do-not-generate-compiler-listing") << false;
+ QTest::newRow("generate-compiler-listing") << true;
}
void TestBlackboxBareMetal::compilerListingFiles()
{
- QFETCH(QString, testPath);
QFETCH(bool, generateListing);
- QDir::setCurrent(testDataDir + testPath);
- QCOMPARE(runQbs(QbsRunParameters("resolve", QStringList("-n"))), 0);
+ QDir::setCurrent(testDataDir + "/compiler-listing");
+
+ rmDirR(relativeBuildDir());
+ QStringList args = {QStringLiteral("modules.cpp.generateCompilerListingFiles:%1")
+ .arg(generateListing ? "true" : "false")};
+
+ QCOMPARE(runQbs(QbsRunParameters("resolve", args)), 0);
if (m_qbsStdout.contains("unsupported toolset:"))
QSKIP(unsupportedToolsetMessage(m_qbsStdout));
- QCOMPARE(runQbs(), 0);
+ if (!m_qbsStdout.contains("compiler listing suffix:"))
+ QFAIL("No current compiler listing suffix pattern exists");
+
+ QString compilerListingSuffix;
+ if (!extractQuitedValue(m_qbsStdout, compilerListingSuffix))
+ QFAIL("Unable to extract current compiler listing suffix");
+
const bool isShortListingNames = m_qbsStdout.contains("using short listing file names");
- const QString productName = testPath.mid(1);
- const QString productBuildDir = relativeProductBuildDir(productName);
+
+ QCOMPARE(runQbs(QbsRunParameters(args)), 0);
+ const QString productBuildDir = relativeProductBuildDir("compiler-listing");
const QString hash = inputDirHash(".");
- const QString mainListing = productBuildDir + "/" + hash + (isShortListingNames ? "/main.lst" : "/main.c.lst");
+ const QString mainListing = productBuildDir + "/" + hash
+ + (isShortListingNames ? "/main" : "/main.c")
+ + compilerListingSuffix;
QCOMPARE(regularFileExists(mainListing), generateListing);
- const QString funListing = productBuildDir + "/" + hash + (isShortListingNames ? "/fun.lst" : "/fun.c.lst");
+ const QString funListing = productBuildDir + "/" + hash
+ + (isShortListingNames ? "/fun" : "/fun.c")
+ + compilerListingSuffix;
QCOMPARE(regularFileExists(funListing), generateListing);
}