-
-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathtests.rb
More file actions
executable file
·39 lines (32 loc) · 747 Bytes
/
tests.rb
File metadata and controls
executable file
·39 lines (32 loc) · 747 Bytes
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
#!/usr/bin/env ruby
require 'English'
errors_only = "true" =~ /^[ty]/i
suite = "all"
out = ""
code = 0
def normalize_suite(suite)
files = Dir.glob("tests/test_*.rb")
suite = suite.split('').join('.*')
if suite && !suite.empty?
files.delete_if { |f| f !~ /#{suite}/ }
end
files.map { |f| File.basename(f, '.rb') }
end
if suite =~ /^all/i
out = `./build/apex_test_runner 2>&1`
code = $CHILD_STATUS.exitstatus
else
test_files = normalize_suite(suite)
test_files.each do |file|
out += `./build/apex_test_runner #{file} 2>&1`
if $CHILD_STATUS.exitstatus != 0
code = $CHILD_STATUS.exitstatus
end
end
end
if errors_only
puts out.lines.select { |line| line =~ /✗/ }.join
else
puts out
end
exit code