Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
73 commits
Select commit Hold shift + click to select a range
d3db347
Formatter.finish: give formatters the ability to know the end
jaredgrubb Dec 13, 2015
b455180
Add Reporter class
Dec 21, 2015
b39bb3f
Finish reporter and add tests
Dec 22, 2015
5c1fd02
Passing tests
Dec 22, 2015
5fe3254
Update all reporters to subclass reporter
Dec 22, 2015
320e9dd
Fix constant to override in subclasses. Add Reporter to feature env
Dec 22, 2015
17b23f2
Make junit subclass Reporter
Dec 22, 2015
baded83
Formatting fixes
Dec 22, 2015
4c572cb
Finish integrating custom reporters and related tests
Dec 22, 2015
9f7e088
Add custom reporter files for test
Dec 22, 2015
4ec0d4d
Add load_dependencies method to reporter so fileutils is always loaded
Dec 22, 2015
9152400
Support aggregate targets
dflems Jan 25, 2016
b276987
Fix rubocop warnings
dflems Jan 26, 2016
8d661d4
Add features for Build/Aggregate/Analyze targets
dflems Jan 26, 2016
d706e6b
omit unnecessary tests
dflems Jan 26, 2016
9343490
Merge pull request #203 from dflems/aggregate-support
supermarin Jan 26, 2016
4ad2c4e
Add the JUnit time attribute on a failed tests.
Feb 1, 2016
83a7c87
Merge pull request #197 from jaredgrubb/jgrubb-formatter-finish
kattrali Mar 27, 2016
d55e22d
Merge pull request #207 from mtitolo/reporters
kattrali Mar 30, 2016
b07769b
README: Fix the path of the json compilation database
jaredgrubb Apr 11, 2016
56e0c5c
Merge pull request #212 from jaredgrubb/patch-1
supermarin Apr 11, 2016
1788a3d
Simple typo (#218)
chrisfsampaio May 3, 2016
caa05df
Add support for custom compiler toolchains
May 15, 2016
19f2f46
Analyzer: match other extensions than just .m
jaredgrubb Dec 13, 2015
87926fc
Ld matcher: match relative paths too
jaredgrubb Dec 13, 2015
35dedec
Fix up unit test and add tests for the new features
jaredgrubb May 15, 2016
70a7bf3
Fix bug whereby syntax highlighting was being performed in non-colori…
Jun 22, 2016
62bbd4e
Fixed issue where the wrong syntax formatter was being used for HTML …
andybest Jul 18, 2016
a770f15
Merge pull request #198 from jaredgrubb/jgrubb-matcher
supermarin Aug 15, 2016
47e4cdf
Correcting the way Xcode 8 XCUITest failures are parsed
ashgti Sep 14, 2016
f1da9d9
Merge pull request #240 from ashgti/master
supermarin Sep 24, 2016
4b90228
add back -c short flag
supermarin Sep 28, 2016
c33d5af
bump version to 0.2.3
supermarin Sep 28, 2016
5dbee66
Handle 'TargetName will not be code signed because' warning
Oct 8, 2016
e53b152
Merge pull request #246 from mgrebenets/feature/will-not-be-code-sign…
supermarin Oct 10, 2016
8ed2ef2
Display failed dependency checks as errors
Oct 8, 2016
1d8c0d5
Merge pull request #247 from mgrebenets/feature/code-signing-required…
supermarin Oct 10, 2016
28a56ab
Revert "Correcting the way Xcode 8 XCUITest failures are parsed"
supermarin Oct 10, 2016
27ed14b
correct parameter
supermarin Oct 11, 2016
b15de8f
add back support for ui tests
supermarin Oct 11, 2016
aca791d
how do i keyword parameters
supermarin Oct 11, 2016
7dd0faf
naming consistency
supermarin Oct 11, 2016
48162e3
Force rspec 2.9.
supermarin Oct 11, 2016
5baa33d
remove rake
supermarin Oct 11, 2016
54205bb
fix lint
supermarin Oct 11, 2016
2eae807
restart jobs
supermarin Oct 11, 2016
36e6186
Fix crash on failing tests
supermarin Oct 11, 2016
f52a62d
bump version 0.2.4
supermarin Oct 11, 2016
fa95f62
return back Rakefile
supermarin Oct 11, 2016
f081d56
Merge pull request #221 from saelo/master
supermarin Oct 11, 2016
de74a1d
dpn't print empty snippets
supermarin Oct 11, 2016
fb3afc6
bump 0.2.5
supermarin Oct 11, 2016
ba8fd7d
Update LICENSE.txt
supermarin Oct 24, 2016
9ae6c0e
fix empty snippet implementation
supermarin Feb 7, 2017
70e262d
add trailing blank line in Rakefile ¯\_(ツ)_/¯
supermarin Feb 7, 2017
5035141
Add matcher for 'No profile matching 'TargetName' found:' dependency …
Jan 21, 2017
2abe496
Merge pull request #265 from mgrebenets/no-profile-matching
supermarin Feb 7, 2017
ce6579d
Fix Screenshots (#269)
mattcotton Feb 14, 2017
7b2d76b
Improve Screenshot Matching (#270)
mattcotton Mar 21, 2017
25b9709
Improve Code sign error checking (#249)
Mitko-Kerezov Mar 22, 2017
422774d
update changelog
supermarin Mar 31, 2017
57fe4ff
bump version to 0.2.6
supermarin Mar 31, 2017
d38e314
Upgrade rouge (#277)
giginet Apr 25, 2017
8c3e0e2
bump version to 0.2.7
supermarin Apr 27, 2017
7a072a1
Improve screenshot support (#280)
mattcotton May 12, 2017
c5e2d10
Add support for <module-includes> errors (#283)
seanabraham May 15, 2017
93b6f87
bump version to 0.2.8
supermarin May 15, 2017
87dd9f8
Fix 291 tests restarting when fatal error (#293)
kenji21 Dec 5, 2017
f140c5a
Add catch-all formatter (#327)
chrisballinger Jul 25, 2018
623146e
Add a "Reviewed by Hound" badge (#331)
salbertson Aug 1, 2018
1eb47d5
Allow clangs other than */bin/clang in compile commands
kattrali Aug 16, 2018
4566043
Release v0.3.0
kattrali Aug 16, 2018
b08ff73
Merge remote-tracking branch 'origin/fix/duration_of_failed_tests_wor…
Apr 20, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
*.gem
*.rbc
.bundle
.vendor
.config
.yardoc
.rspec
Expand Down
7 changes: 4 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
language: ruby
sudo: false
install:
- bundle install

rvm:
- 2.1.1
- 2.0.0

script: rake ci
script:
- rake spec
- rake cucumber
- rake lint

25 changes: 25 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,30 @@
# Changelog

## 0.3.0

###### Enhancements

* Add catch-all formatter to allow formatting unrecognized text
| [Chris Ballinger](https://github.com/chrisballinger)
| [#327](https://github.com/supermarin/xcpretty/pull/327)

* Support `ccache-clang` (and other commands) in formatted output and JSON
compilation database reports
| [Delisa Mason](https://github.com/kattrali)
| [#332](https://github.com/supermarin/xcpretty/pull/332)


## 0.2.6

* Codesigning matchers improvements
* Screenshots parsing fixes

###### Bug fixes

* Fix reporers crash by default ld warning implementation
| [iKiKi](https://github.com/iKiKi)
| [#187](https://github.com/supermarin/xcpretty/pull/187)

## 0.2.1

###### Bug fixes
Expand Down
2 changes: 1 addition & 1 deletion LICENSE.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2013 Marin Usalj
Copyright (c) 2013-2016 Marin Usalj

MIT License

Expand Down
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ It does one thing, and it should do it well.
[![Gem version](http://img.shields.io/gem/v/xcpretty.svg)](http://rubygems.org/gems/xcpretty)
[![Build Status](https://travis-ci.org/supermarin/xcpretty.svg?branch=master)](https://travis-ci.org/supermarin/xcpretty)
[![Code Climate](http://img.shields.io/codeclimate/github/supermarin/xcpretty.svg)](https://codeclimate.com/github/supermarin/xcpretty)
[![Reviewed by Hound](https://img.shields.io/badge/Reviewed_by-Hound-8E64B0.svg)](https://houndci.com)

## Installation
``` bash
Expand Down Expand Up @@ -67,7 +68,7 @@ $ xcodebuild [flags] | tee xcodebuild.log | xcpretty
- `--report html`, `-r html`: Creates a simple HTML report at `build/reports/tests.html`.
![xcpretty html](http://i.imgur.com/0Rnux3v.gif)

- `--report json-compilation-database`, `-r json-compilation-database`: Creates a [JSON compilation database](http://clang.llvm.org/docs/JSONCompilationDatabase.html) at `build/reports/compilation.json`. This is a format to replay single compilations independently of the build system.
- `--report json-compilation-database`, `-r json-compilation-database`: Creates a [JSON compilation database](http://clang.llvm.org/docs/JSONCompilationDatabase.html) at `build/reports/compilation_db.json`. This is a format to replay single compilations independently of the build system.

Writing a report to a custom path can be specified using `--output PATH`.

Expand All @@ -76,7 +77,7 @@ Writing a report to a custom path can be specified using `--output PATH`.
`xcpretty` supports custom formatters through the use of the
`--formatter` flag, which takes a path to a file as an argument. The
file must contain a Ruby subclass of `XCPretty::Formatter`, and
return that class at the end of te file. The class
return that class at the end of the file. The class
can override the `format_*` methods to hook into output parsing
events.

Expand Down
21 changes: 7 additions & 14 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -1,25 +1,18 @@
require "bundler/gem_tasks"
require 'rubocop/rake_task'
require 'rspec/core/rake_task'
require 'cucumber/rake/task'
require 'bundler/gem_tasks'

task :kick do
sh 'bundle exec kicker -r ruby'
end

Cucumber::Rake::Task.new(:cucumber) do |task|
task :spec do
sh 'bundle exec rspec --color --format=doc'
end

RSpec::Core::RakeTask.new(:spec) do |task|
task.rspec_opts = %w(--color --format=doc)
task :cucumber do
sh 'bundle exec cucumber'
end

RuboCop::RakeTask.new(:lint) do |task|
task.fail_on_error = false
task :lint do
sh 'bundle exec rubocop'
end

task :ci do
Rake::Task[:spec].invoke
Rake::Task[:cucumber].invoke
Rake::Task[:lint].invoke
end
25 changes: 13 additions & 12 deletions assets/report.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@
.test.passing { background-color: #CAF59F;}
.test.failing.odd { background-color: #EEC7CC;}
.test.passing.odd { background-color: #E5FBCF;}
.details { background-color: #F4DDE0; border: 1px solid #C84F5E;}
.details.failing { background-color: #F4DDE0; border: 1px solid #C84F5E;}
.details.passing { background-color: #E5F4DC; border: 1px solid #A1D761;}
.test .test-detail:last-child { padding-bottom: 8px;}
.test .title { float: left; font-size: 0.9em; margin-top: 8px; font-family: Menlo, Monaco, monospace;}
.test .time { float: left;margin: 4px 10px 0 20px;}
Expand Down Expand Up @@ -127,15 +128,6 @@
<h3 class="title"><%= name %></h3>
</section>
<section class="tests">
<% unless info[:screenshots].empty? %>
<div class="screenshots <%= info[:failing] ? 'failing' : 'passing'%>">
<% info[:screenshots].each_with_index do |screenshot, index| %>
<a href="javascript:toggleScreenshot('<%=name %>', <%=index %>)">
<img class="screenshot" id="screenshot-<%=name %>-<%=index %>" src="<%=screenshot %>" />
</a>
<% end %>
</div>
<% end %>
<table>
<% info[:tests].each_with_index do |test, index| %>
<% detail_class = test[:name].gsub(/\s/,'') %>
Expand All @@ -147,8 +139,8 @@
</td>
<td><h3 class="title"><%= test[:name] %></h3></td>
</tr>
<% if test[:reason] || test[:snippet] %>
<tr class="details <%= detail_class %>">
<% if test[:reason] || test[:snippet] || !test[:screenshots].empty? %>
<tr class="details <%= test[:failing] ? 'failing' : 'passing'%> <%= detail_class %>">
<td></td>
<td>
<% if test[:reason] %>
Expand All @@ -158,6 +150,15 @@
<section class="test-detail snippet"><%= test[:snippet] %></section>
<section class="test-detail"><%= test[:file] %></section>
<% end %>
<% if !test[:screenshots].empty? %>
<section class="test-detail">
<% test[:screenshots].each_with_index do |screenshot, idx| %>
<a href="javascript:toggleScreenshot('<%=test[:name] %>', <%=index %>)">
<img class="screenshot" id="screenshot-<%=test[:name] %>-<%=index %>" src="<%=screenshot %>" />
</a>
<% end %>
</section>
<% end %>
</td>
</tr>
<% end %>
Expand Down
13 changes: 9 additions & 4 deletions bin/xcpretty
Original file line number Diff line number Diff line change
Expand Up @@ -39,17 +39,21 @@ OptionParser.new do |opts|
printer_opts[:formatter] = XCPretty::TestAnything
end
opts.on('-f', '--formatter PATH', 'Use formatter returned from evaluating the specified Ruby file') do |path|
printer_opts[:formatter] = XCPretty.load_custom_formatter(path)
printer_opts[:formatter] = XCPretty.load_custom_class(path)
end
opts.on('--[no-]color', 'Use colorized output. Defaults is auto') do |value|
opts.on('-c', '--[no-]color', 'Use colorized output. Default is auto') do |value|
printer_opts[:colorize] = value
end
opts.on('--[no-]utf', 'Use unicode characters in output. Default is auto.') do |value|
printer_opts[:unicode] = value
end
opts.on("-r", "--report FORMAT", "Run FORMAT reporter",
opts.on("-r", "--report FORMAT or PATH", "Run FORMAT or PATH reporter",
" Choices: #{report_formats.keys.join(', ')}") do |format|
report_classes << report_formats[format]
if report_formats.key?(format)
report_classes << report_formats[format]
else
report_classes << XCPretty.load_custom_class(format)
end
report_options << {}
end
opts.on('-o', '--output PATH', 'Write report output to PATH') do |path|
Expand Down Expand Up @@ -81,5 +85,6 @@ STDIN.each_line do |line|
reporters.each { |r| r.handle(line) }
end

printer.finish
reporters.each(&:finish)

29 changes: 29 additions & 0 deletions features/custom_reporter.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
Feature: Loading an arbitrary Ruby file as a reporter

Background:
Given the tests have started running

Scenario: The file loaded does not contain a Ruby class
When I pipe to xcpretty with "-r /bin/bash"
Then the exit status code should be 1

Scenario: The file loaded contains a Ruby class
Given I have a file to compile
When I pipe to xcpretty with a custom reporter
Then the exit status code should be 0

Scenario: Showing failed tests
Given I have a failing test in my suite
When I pipe to xcpretty with a custom reporter
Then I should see a failed test in my custom report
And the custom failure counter should show 1 test

Scenario: Showing passing tests
Given I have a passing test in my suite
When I pipe to xcpretty with a custom reporter
Then I should see a passing test in my custom report

Scenario: Showing pending tests
Given I have a pending test in my suite
When I pipe to xcpretty with a custom reporter
Then I should see a pending test in my custom report
7 changes: 7 additions & 0 deletions features/json_compilation_database_report.feature
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@ Feature: Create a JSON compilation database
Then the JSON compilation database should contain an entry with a directory
Then the JSON compilation database should contain an entry with a file

Scenario: Showing file compilation with CCache
Given I have a file to compile with ccache
When I pipe to xcpretty with "--report json-compilation-database" and specify a custom path
Then the JSON compilation database should contain an entry with a command
Then the JSON compilation database should contain an entry with a directory
Then the JSON compilation database should contain an entry with a file

Scenario: Handling a complete xcodebuild session
Given some big input
When I pipe to xcpretty with "--report json-compilation-database" and specify a custom path
Expand Down
5 changes: 5 additions & 0 deletions features/junit_report.feature
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,8 @@ Feature: Creating a JUnit test report
Scenario: Writing to multiple custom file paths
When I pipe to xcpretty with two custom "junit" report paths
Then I should have test reports in two custom paths

Scenario: Showing tests with one having a swift fatal error
Given I have a swift fatal error in a test in my suite
When I pipe to xcpretty with "--report junit"
Then I should see a failed test node in my report
34 changes: 34 additions & 0 deletions features/simple_format.feature
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ Feature: Showing build output in simple format
When I pipe to xcpretty with "--simple --no-color"
Then I should see a successful compilation message

Scenario: Showing file compilation with CCache
Given I have a file to compile with ccache
When I pipe to xcpretty with "--simple --no-color"
Then I should see a successful compilation message

Scenario: Showing xib compilation
Given I have a xib to compile
When I pipe to xcpretty with "--simple --no-color"
Expand Down Expand Up @@ -45,6 +50,11 @@ Feature: Showing build output in simple format
When I pipe to xcpretty with "--simple --color"
Then I should see a yellow completion icon

Scenario: Showing aggregate target
Given I have an aggregate target to build
When I pipe to xcpretty with "--simple --no-color"
Then I should see an aggregate target message

Scenario: Showing analyze
Given I have a file to analyze
When I pipe to xcpretty with "--simple --no-color"
Expand Down Expand Up @@ -162,6 +172,11 @@ Feature: Showing build output in simple format
When I pipe to xcpretty with "--simple --no-color"
Then I should see a successful code signing message

Scenario: Showing target will not be code signed warning
Given I have a target which will not be code signed
When I pipe to xcpretty with "--simple --color"
Then I should see a target will not be code signed warning

Scenario: Showing preprocess
Given I have a file to preprocess
When I pipe to xcpretty with "--simple --no-color"
Expand Down Expand Up @@ -202,3 +217,22 @@ Feature: Showing build output in simple format
When I pipe to xcpretty with "--simple --color"
Then I should see a yellow warning message

Scenario: Showing provisioning profile doesn't support capability
Given the provisioning profile doesn't support capability
When I pipe to xcpretty with "--simple --no-color"
Then I should see the profile doesn't support capability message

Scenario: Showing provisioning profile doesn't include entitlement
Given the provisioning profile doesn't include entitlement
When I pipe to xcpretty with "--simple --no-color"
Then I should see the profile doesn't include entitlement message

Scenario: Showing code signing is required error
Given the target requires code signing
When I pipe to xcpretty with "--simple --no-color"
Then I should see the code signing is requried message

Scenario: Showing no profile matching error
Given the matching profile is missing
When I pipe to xcpretty with "--simple --no-color"
Then I should see the no profile matching message
16 changes: 16 additions & 0 deletions features/steps/custom_reporter_steps.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
Then(/^I should see a passing test in my custom report$/) do
custom_report.should include("WOW such PASS.")
end

Then(/^I should see a failed test in my custom report$/) do
custom_report.should include("WOW such FAIL.")
end

Then(/^I should see a pending test in my custom report$/) do
custom_report.should include("WOW such PENDING.")
end

Then(/^the custom failure counter should show (\d+) tests?$/) do |fail_count|
custom_report.should include("Much 1 FAIL.")
end

Loading