diff options
author | Christian Kandeler <christian.kandeler@digia.com> | 2014-01-13 10:36:50 +0100 |
---|---|---|
committer | Joerg Bornemann <joerg.bornemann@digia.com> | 2014-01-13 11:39:23 +0100 |
commit | fce20ac83943d94e3bd465c41b03bd1e5d0c756f (patch) | |
tree | 92bd28b40756074e418619489087a09e2e60a543 | |
parent | 6c121793496879a2b063fe0793398aac9b7be4e2 (diff) |
Tighten sanity check.
Check for the same file appearing as different artifacts in a child
list. See QBS-491 for an example.
Change-Id: Ie93268c05386ccfae2a57097a19e5ec7d135902a
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
-rw-r--r-- | src/lib/buildgraph/buildgraph.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/lib/buildgraph/buildgraph.cpp b/src/lib/buildgraph/buildgraph.cpp index 1d389d536..d80aebe84 100644 --- a/src/lib/buildgraph/buildgraph.cpp +++ b/src/lib/buildgraph/buildgraph.cpp @@ -446,10 +446,21 @@ static void doSanityChecksForProduct(const ResolvedProductConstPtr &product, con QBS_CHECK(transformer); QBS_CHECK(transformer->outputs.contains(artifact)); + logger.qbsDebug() << "The transformer has " << transformer->outputs.count() + << " outputs."; ArtifactList transformerOutputChildren; foreach (const Artifact * const output, transformer->outputs) { QBS_CHECK(output->transformer == transformer); transformerOutputChildren.unite(output->children); + QSet<QString> childFilePaths; + foreach (const Artifact * const a, output->children) { + if (childFilePaths.contains(a->filePath())) { + throw ErrorInfo(QString::fromLocal8Bit("There is more than one artifact for " + "file '%1' in the child list for output '%2'.") + .arg(a->filePath(), output->filePath()), CodeLocation(), true); + } + childFilePaths << a->filePath(); + } } if (logger.traceEnabled()) { logger.qbsTrace() << "The transformer output children are:"; |