Skip to content

Commit

Permalink
Check dependencies has no output if no problems are found
Browse files Browse the repository at this point in the history
Treat all unrecognized lines as warnings
  • Loading branch information
Martin Bektchiev committed Mar 28, 2017
1 parent 25b9709 commit 992e264
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 0 deletions.
11 changes: 11 additions & 0 deletions lib/xcpretty/parser.rb
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,8 @@ module Errors
# @regex Captured groups
# $1 = reference
SYMBOL_REFERENCED_FROM_MATCHER = /\s+"(.*)", referenced from:$/

EMPTY_LINE_MATCHER = /^\s?*$/
end
end

Expand Down Expand Up @@ -411,6 +413,11 @@ def parse(text)
when WILL_NOT_BE_CODE_SIGNED_MATCHER
formatter.format_will_not_be_code_signed($1)
else
# Check dependencies has no output if no problems are found
# Treat all unrecognized lines as warnings
if @check_dependencies_phase
formatter.format_warning(text)
end
""
end
end
Expand All @@ -432,6 +439,10 @@ def update_test_state(text)
store_failure(file: $1, test_suite: $2, test_case: $3, reason: $4)
when UI_FAILING_TEST_MATCHER
store_failure(file: $1, test_suite: @test_suite, test_case: @test_case, reason: $2)
when CHECK_DEPENDENCIES_MATCHER
@check_dependencies_phase = true
when EMPTY_LINE_MATCHER
@check_dependencies_phase = false
end
end

Expand Down
2 changes: 2 additions & 0 deletions spec/fixtures/constants.rb
Original file line number Diff line number Diff line change
Expand Up @@ -671,3 +671,5 @@

SAMPLE_WILL_NOT_BE_CODE_SIGNED = "FrameworkName will not be code signed because its settings don't specify a development team."

SAMPLE_CHECK_DEPENDENCIES_WARNING = "Some unparsed dependency issue"

9 changes: 9 additions & 0 deletions spec/xcpretty/parser_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -552,6 +552,15 @@ module XCPretty
@formatter.should receive(:format_will_not_be_code_signed).with(SAMPLE_WILL_NOT_BE_CODE_SIGNED)
@parser.parse(SAMPLE_WILL_NOT_BE_CODE_SIGNED)
end

it "parses Check dependencies unknown output" do
@formatter.should receive(:format_warning).with(SAMPLE_CHECK_DEPENDENCIES_WARNING)
@formatter.should_not receive(:format_warning).with("Another phase output")
@parser.parse("Check dependencies")
@parser.parse(SAMPLE_CHECK_DEPENDENCIES_WARNING)
@parser.parse("\n")
@parser.parse("Another phase output")
end
end

context "summary" do
Expand Down

0 comments on commit 992e264

Please sign in to comment.