-
Notifications
You must be signed in to change notification settings - Fork 0
/
.autotest
64 lines (52 loc) · 2.1 KB
/
.autotest
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
# -*- ruby -*-
# require 'autotest/autoupdate' # update after some time
# require 'autotest/camping'
# require 'autotest/cctray'
# require 'autotest/emacs'
# require 'autotest/email_notify'
# require 'autotest/fixtures'
# require 'autotest/growl' # osx notify (gem autotest-growl)
# require 'autotest/heckle'
# require 'autotest/html_report'
# require 'autotest/jabber_notify'
# require 'autotest/kdenotify' # kde notify (gem ?)
# require 'autotest/menu'
# require 'autotest/migrate'
# require 'autotest/notify'
# require 'autotest/once' # run only once
# require 'autotest/pretty'
# require 'autotest/rcov' # add rcov settings
# require 'autotest/redgreen' # red or green color (gem redgreen)
# require 'autotest/restart' # Autotest will restart itself as soon as a change in the .autotest file is detected.
# require 'autotest/screen' # Notify in GNU screen's status line (gem autotest_screen)
# require 'autotest/shame'
# require 'autotest/snarl' # win32 notify (gem ?)
# require 'autotest/timestamp' # print timestamps of files
# Override autotest default magic deciding which test to run when
# a file is changed : enable more flexible naming conventions
# trading some of the efficiency: we rerun all the tests each time.
# class Autotest
#
# def tests_for_file(filename)
# return Dir["test/**/*.rb"] # tc_#{filename}
# end
#
# end
$q = true # be quiet
class Autotest
alias old_path_to_classname path_to_classname
# Custom method for ZenTest class name conventions.
def path_to_classname(s)
@my_test_class_names ||= IO.readlines('test/ts_all_tests.rb').find_all{ |l| l =~ /suite <</ }.collect{ |l| l.gsub(/\s*suite\s*<<\s*|\.suite\s*/, '')}
cn = old_path_to_classname(s)
my_cn = @my_test_class_names.find { |l| l =~ /#{cn}/ }
my_cn ? my_cn : cn
end
end
# See:: http://ph7spot.com/musings/getting-started-with-autotest
# ignore other content
Autotest.add_hook :initialize do |autotest|
[/(?:\.git|\.hg|hosting|test\/data)[\/\\].*$/, /\.(?:pdf|txt|bat|java)$/i ].each do |exception|
autotest.add_exception(exception)
end
end