Created
April 18, 2012 19:27
-
-
Save jstorimer/2415933 to your computer and use it in GitHub Desktop.
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
# Put filenames on the pipe to have them loaded | |
# $ echo test/unit/foo_test.rb > zippy.pipe | |
require 'benchmark' | |
# | |
# load rails and the gems | |
result = Benchmark.realtime { require './config/application' } | |
puts "Loading gems took #{result}s" | |
# open pipe | |
pipe = open('zippy.pipe', 'r+') | |
loop do | |
filename = pipe.gets.strip | |
# create a process to run the tests | |
fork do | |
result = Benchmark.realtime { require File.expand_path(filename) } | |
puts "Running test took #{result}s" | |
end | |
Process.wait | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment