forked from drbrain/opengl
-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy path.autotest
29 lines (24 loc) · 767 Bytes
/
.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
require 'autotest/restart'
Autotest.add_hook :initialize do |at|
at.add_exception /\.git/
at.add_exception /doc/
at.add_exception /examples/
at.add_exception /utils/
at.add_exception /website/
at.add_mapping(/^lib\/.*(\.bundle|so|dll)$/) do |filename, match|
possible = File.basename(filename, match[1])
at.files_matching %r%^test/test_#{possible}%
end
def at.path_to_classname s
sep = File::SEPARATOR
n = s.sub(/^test#{sep}test_(.*)\.rb/, '\1')
c = if n =~ /^(glu?)_?(.*)/ then
"#{$1.capitalize}#{$2.split(/_|(\d+)/).map { |seg| seg.capitalize }.join}"
end
"Test#{c}"
end
end
Autotest.add_hook :run_command do |at|
at.unit_diff = 'cat'
system Gem.ruby, Gem.bin_path('rake', 'rake'), 'compile'
end