-
-
Notifications
You must be signed in to change notification settings - Fork 109
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #92 from vineetchoudhary/development
Development
- Loading branch information
Showing
43 changed files
with
2,225 additions
and
171 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
22 changes: 22 additions & 0 deletions
22
AppBox/Assets/AppBoxIcons.xcassets/CI.imageset/Contents.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
{ | ||
"images" : [ | ||
{ | ||
"idiom" : "universal", | ||
"scale" : "1x" | ||
}, | ||
{ | ||
"idiom" : "universal", | ||
"filename" : "[email protected]", | ||
"scale" : "2x" | ||
}, | ||
{ | ||
"idiom" : "universal", | ||
"filename" : "[email protected]", | ||
"scale" : "3x" | ||
} | ||
], | ||
"info" : { | ||
"version" : 1, | ||
"author" : "xcode" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
#!/usr/bin/env ruby | ||
|
||
if RUBY_VERSION < '2.0.0' | ||
abort "error: XCPretty requires Ruby 2.0.0 or higher." | ||
end | ||
|
||
if $PROGRAM_NAME == __FILE__ | ||
$LOAD_PATH.unshift File.expand_path('../../lib', __FILE__) | ||
end | ||
require 'xcpretty' | ||
require 'optparse' | ||
|
||
report_options = [] | ||
report_classes = [] | ||
report_formats = { | ||
"junit" => XCPretty::JUnit, | ||
"html" => XCPretty::HTML, | ||
"json-compilation-database" => XCPretty::JSONCompilationDatabase | ||
} | ||
|
||
printer_opts = { | ||
unicode: XCPretty::Term.unicode?, | ||
colorize: XCPretty::Term.color?, | ||
formatter: XCPretty::Simple | ||
} | ||
|
||
OptionParser.new do |opts| | ||
opts.banner = "Usage: xcodebuild [options] | xcpretty" | ||
opts.on('-t', '--test', 'Use RSpec style output') do | ||
printer_opts[:formatter] = XCPretty::RSpec | ||
end | ||
opts.on('-s', '--simple', 'Use simple output (default)') do | ||
printer_opts[:formatter] = XCPretty::Simple | ||
end | ||
opts.on('-k', '--knock', 'Use knock output') do | ||
printer_opts[:formatter] = XCPretty::Knock | ||
end | ||
opts.on('--tap', 'Use TAP output') do | ||
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_class(path) | ||
end | ||
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 or PATH", "Run FORMAT or PATH reporter", | ||
" Choices: #{report_formats.keys.join(', ')}") do |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| | ||
unless opts = report_options.last | ||
XCPretty.exit_with_error('Expected report format to be specified before output path') | ||
end | ||
opts[:path] = path | ||
end | ||
opts.on('--screenshots', 'Collect screenshots in the HTML report') do | ||
unless opts = report_options.last | ||
XCPretty.exit_with_error('Expected screenshot argument to be specified after report format') | ||
end | ||
opts[:screenshots] = true | ||
end | ||
opts.on_tail('-h', '--help', 'Show this message') { puts opts; exit } | ||
opts.on_tail("-v", "--version", "Show version") { puts XCPretty::VERSION; exit } | ||
opts.parse! | ||
|
||
if STDIN.tty? | ||
XCPretty.exit_with_error(opts.help) | ||
end | ||
end | ||
|
||
printer = XCPretty::Printer.new(printer_opts) | ||
reporters = report_classes.compact.each_with_index.map { |k, i| k.new(report_options[i]) } | ||
|
||
STDIN.each_line do |line| | ||
printer.pretty_print(line) | ||
reporters.each { |r| r.handle(line) } | ||
end | ||
|
||
printer.finish | ||
reporters.each(&:finish) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
require 'xcpretty/version' | ||
require 'xcpretty/printer' | ||
require 'xcpretty/syntax' | ||
require 'xcpretty/snippet' | ||
require 'xcpretty/term' | ||
require 'xcpretty/formatters/formatter' | ||
require 'xcpretty/formatters/simple' | ||
require 'xcpretty/formatters/rspec' | ||
require 'xcpretty/formatters/knock' | ||
require 'xcpretty/formatters/tap' | ||
require 'xcpretty/reporters/reporter' | ||
require 'xcpretty/reporters/junit' | ||
require 'xcpretty/reporters/html' | ||
require 'xcpretty/reporters/json_compilation_database' | ||
|
||
module XCPretty | ||
|
||
def self.class_from_path(path) | ||
source = File.read(path) | ||
klass = eval(source, nil, path) | ||
raise unless klass.is_a?(Class) | ||
klass | ||
end | ||
|
||
def self.load_custom_class(path) | ||
$LOAD_PATH.unshift File.dirname(path) | ||
class_from_path(path) | ||
rescue SyntaxError => e | ||
exit_with_error("Expected custom source file to return a class. #{e}") | ||
end | ||
|
||
def self.exit_with_error(message) | ||
$stderr.puts "[!] #{message}" | ||
exit 1 | ||
end | ||
|
||
end | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
module XCPretty | ||
module ANSI | ||
|
||
attr_accessor :colorize | ||
|
||
FORMATTED_MATCHER = %r{\e\[(\d+)[;]?(\d+)?m(.*)\e\[0m} | ||
|
||
EFFECT = { | ||
reset: '0', | ||
bold: '1', | ||
underline: '4' | ||
} | ||
|
||
COLORS = { | ||
black: '30', | ||
red: '31', | ||
green: '32', | ||
yellow: '33', | ||
blue: '34', | ||
cyan: '36', | ||
white: '37', | ||
plain: '39' | ||
} | ||
|
||
def colorize? | ||
!!@colorize | ||
end | ||
|
||
def white(text) | ||
ansi_parse(text, :plain, :bold) | ||
end | ||
|
||
def red(text) | ||
ansi_parse(text, :red) | ||
end | ||
|
||
def green(text) | ||
ansi_parse(text, :green, :bold) | ||
end | ||
|
||
def cyan(text) | ||
ansi_parse(text, :cyan) | ||
end | ||
|
||
def yellow(text) | ||
ansi_parse(text, :yellow) | ||
end | ||
|
||
def applied_effects(text) | ||
effects = [] | ||
if text =~ FORMATTED_MATCHER | ||
colors = COLORS.invert[$1] | ||
effect = EFFECT.invert[$2] | ||
effects << colors if colors | ||
effects << effect if effect | ||
end | ||
effects | ||
end | ||
|
||
def strip(text) | ||
text =~ FORMATTED_MATCHER ? $3 : text | ||
end | ||
|
||
def ansi_parse(text, color, effect=nil) | ||
return text unless colorize? | ||
colors_code = COLORS[color] || '' | ||
effect_code = EFFECT[effect] ? ';' + EFFECT[effect] : '' | ||
"\e[#{colors_code}#{effect_code}m#{text}\e[#{EFFECT[:reset]}m" | ||
end | ||
end | ||
end | ||
|
Oops, something went wrong.