Skip to content

Commit

Permalink
Fixed -f and last_mtime in general. We need better tests.
Browse files Browse the repository at this point in the history
[git-p4: depot-paths = "//src/ZenTest/dev/": change = 3820]
  • Loading branch information
zenspider committed Feb 8, 2008
1 parent 3cbabcf commit 5a59414
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
12 changes: 9 additions & 3 deletions lib/autotest.rb
Expand Up @@ -234,7 +234,10 @@ def get_to_green
def run_tests
hook :run_command

self.find_files_to_test
new_mtime = self.find_files_to_test
return unless new_mtime
self.last_mtime = new_mtime

cmd = self.make_test_cmd self.files_to_test

puts cmd unless $q
Expand Down Expand Up @@ -377,8 +380,11 @@ def find_files_to_test(files=find_files)
self.files_to_test[filename] # creates key with default value
end

self.last_mtime = files.values.max
not updated.empty?
if updated.empty? then
nil
else
files.values.max
end
end

##
Expand Down
2 changes: 1 addition & 1 deletion lib/zentest.rb
Expand Up @@ -56,7 +56,7 @@ def zentest

class ZenTest

VERSION = '3.9.1'
VERSION = '3.9.2'

include ZenTestMapping

Expand Down
4 changes: 2 additions & 2 deletions test/test_autotest.rb
Expand Up @@ -404,8 +404,8 @@ def util_exceptions
end

def util_find_files_to_test(f, expected)
t = @a.last_mtime + 1
files = { f => t }
t = @a.last_mtime
files = { f => t + 1 }

assert @a.find_files_to_test(files)
assert_equal expected, @a.files_to_test
Expand Down

0 comments on commit 5a59414

Please sign in to comment.