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 24, 2017
1 parent 25b9709 commit 22f18c7
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 0 deletions.
9 changes: 9 additions & 0 deletions lib/xcpretty/parser.rb
Original file line number Diff line number Diff line change
Expand Up @@ -411,6 +411,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 +437,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 ""
@check_dependencies_phase = false
end
end

Expand Down
1 change: 1 addition & 0 deletions spec/fixtures/constants.rb
Original file line number Diff line number Diff line change
Expand Up @@ -671,3 +671,4 @@

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("")
@parser.parse("Another phase output")
end
end

context "summary" do
Expand Down

0 comments on commit 22f18c7

Please sign in to comment.