lib/tork/driver.rb in tork-19.0.2 vs lib/tork/driver.rb in tork-19.1.0
- old
+ new
@@ -27,11 +27,11 @@
def run_all_test_files
all_test_files = Dir[*ALL_TEST_FILE_GLOBS]
if all_test_files.empty?
tell @client, 'There are no test files to run.'
else
- run_test_files all_test_files
+ run_non_overhead_test_files all_test_files
end
end
# accept and delegate tork-engine(1) commands
Engine.public_instance_methods(false).each do |name|
@@ -50,31 +50,37 @@
send @clients, message # propagate downstream
when @herald
message.each do |changed_file|
# reabsorb text execution overhead if overhead files changed
- overhead_changed = REABSORB_FILE_GREPS.any? do |pattern|
- if pattern.kind_of? Regexp
- pattern =~ changed_file
- else
- pattern == changed_file
- end
- end
-
- if overhead_changed
+ if overhead_file? changed_file
send @clients, [:reabsorb, changed_file]
reabsorb_overhead
else
- run_test_files find_dependent_test_files(changed_file).to_a
+ run_non_overhead_test_files find_dependent_test_files(changed_file)
end
end
else
super
end
end
private
+
+ def run_non_overhead_test_files test_files
+ run_test_files test_files.reject {|f| overhead_file? f }
+ end
+
+ def overhead_file? file
+ REABSORB_FILE_GREPS.any? do |pattern|
+ if pattern.kind_of? Regexp
+ pattern =~ file
+ else
+ pattern == file
+ end
+ end
+ end
def find_dependent_test_files source_file, results=Set.new
TEST_FILE_GLOBBERS.each do |regexp, globber|
if regexp =~ source_file and globs = globber.call($~)
Dir[*globs].each do |dependent_file|