Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
rename project to testr and reimplement everything
- Loading branch information
Showing
23 changed files
with
601 additions
and
544 deletions.
There are no files selected for viewing
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 | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,4 @@ | |||
*.gem | |||
.bundle | |||
Gemfile.lock | |||
pkg/* |
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 | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,4 @@ | |||
source "http://rubygems.org" | |||
|
|||
# Specify your gem's dependencies in testr.gemspec | |||
gemspec |
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 | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1 @@ | |||
require "bundler/gem_tasks" |
This file was deleted.
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
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,55 @@ | |||
#!/usr/bin/env ruby | |||
|
|||
require 'json' | |||
require 'testr/client' | |||
|
|||
@driver = TestR::Client::Transceiver.new('testr-driver') do |line| | |||
event, *details = JSON.load(line) | |||
|
|||
case event = event.to_sym | |||
when :load then warn 'testr: Overhead absorbed; Ready for testing!' | |||
when :over then warn 'testr: Reabsorbing changed overhead files...' | |||
else | |||
test_file, test_names, *details = details | |||
message = [event.upcase, test_file, test_names.inspect, details].join(' ') | |||
|
|||
color = case event | |||
when :pass then "\e[32m%s\e[0m" # green | |||
when :fail then "\e[31m%s\e[0m" # red | |||
end | |||
message = color % message if color and STDOUT.tty? | |||
message = [message, File.read(test_file + '.log'), message] if event == :fail | |||
|
|||
puts message | |||
end | |||
end | |||
|
|||
COMMANDS = { | |||
'r' => :run_all_test_files, | |||
's' => :stop_running_test_files, | |||
'p' => :rerun_passed_test_files, | |||
'f' => :rerun_failed_test_files, | |||
'o' => :reabsorb_overhead_files, | |||
'q' => :quit, | |||
} | |||
|
|||
def COMMANDS.show | |||
each {|key, cmd| warn "testr: Type #{key} to #{cmd.to_s.tr('_', ' ')}." } | |||
end | |||
|
|||
COMMANDS.show # instruct newbies | |||
|
|||
while key = STDIN.gets.chomp | |||
if command = COMMANDS[key] | |||
if command == :quit | |||
@driver.quit | |||
break | |||
else | |||
@driver.send [command] | |||
end | |||
else | |||
COMMANDS.show | |||
end | |||
end | |||
|
|||
Process.waitall |
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 | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,4 @@ | |||
#!/usr/bin/env ruby | |||
require 'testr/driver' | |||
TestR::Driver.loop | |||
Process.waitall |
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 | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,9 @@ | |||
#!/usr/bin/env ruby | |||
STDOUT.sync = true | |||
|
|||
require 'guard' | |||
require 'guard/listener' | |||
|
|||
listener = Guard::Listener.select_and_init | |||
listener.on_change {|files| puts files } | |||
listener.start |
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 | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,4 @@ | |||
#!/usr/bin/env ruby | |||
require 'testr/master' | |||
TestR::Master.loop | |||
raise SystemExit # prevent empty test suite from running in the master process |
Oops, something went wrong.