From b84c82c222c712a6d201c6d8e0900d419ddb84b7 Mon Sep 17 00:00:00 2001 From: Fred Potter Date: Sat, 13 Jul 2013 17:19:54 -0700 Subject: [PATCH] fix issue where -failOnWarnings might not fail when it should. 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. --- xctool/xctool/AnalyzeAction.m | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/xctool/xctool/AnalyzeAction.m b/xctool/xctool/AnalyzeAction.m index bee7fb12d..af5a5043d 100644 --- a/xctool/xctool/AnalyzeAction.m +++ b/xctool/xctool/AnalyzeAction.m @@ -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) {