Skip to content
This repository has been archived by the owner on Feb 2, 2021. It is now read-only.

Commit

Permalink
fix issue where -failOnWarnings might not fail when it should.
Browse files Browse the repository at this point in the history
We don't want to overwrite `haveFoundWarnings` for each buildable we
look at.  It could happen that one buildable had warnings, but then a
later buildable didn't and we'd incorrectly conclude that the entire
set had no warnings.
  • Loading branch information
fpotter committed Jul 14, 2013
1 parent 00415bd commit b84c82c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions xctool/xctool/AnalyzeAction.m
Original file line number Diff line number Diff line change
Expand Up @@ -244,19 +244,21 @@ - (BOOL)performActionWithOptions:(Options *)options
return NO;
}


BOOL haveFoundWarnings = NO;

for (NSDictionary *buildable in buildTargetsCollector.seenTargets) {
if (_onlySet.count && ![_onlySet containsObject:buildable[@"targetName"]]) {
continue;
}

BOOL foundWarningsInBuildable = NO;
[self.class emitAnalyzerWarningsForProject:buildable[@"projectName"]
target:buildable[@"targetName"]
options:options
xcodeSubjectInfo:xcodeSubjectInfo
toReporters:options.reporters
foundWarnings:&haveFoundWarnings];
foundWarnings:&foundWarningsInBuildable];
haveFoundWarnings |= foundWarningsInBuildable;
}

if (self.failOnWarnings) {
Expand Down

0 comments on commit b84c82c

Please sign in to comment.