forked from NREL/ComStock
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rakefile
48 lines (44 loc) · 1.43 KB
/
Rakefile
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
require 'rake'
require 'rake/testtask'
require 'minitest/reporters' # Require the gem
# Configure the JUnit reporter
desc 'Perform tasks related to unit tests'
namespace :unit_tests do
desc 'Run measure tests'
Rake::TestTask.new('measure_tests') do |t|
MEASURETESTS_PATH = "test/measure_tests.txt"
if File.exist?(MEASURETESTS_PATH)
# load test files from file.
full_file_list = FileList.new(File.readlines(MEASURETESTS_PATH).map(&:chomp))
full_file_list.select! { |item| item.include?('rb')}
p full_file_list
end
t.test_files = full_file_list
p(full_file_list)
t.verbose = false
t.warning = false
end
Rake::TestTask.new('resource_measure_tests') do |t|
RESOURCE_MEASURETESTS_PATH = "test/resource_measure_tests.txt"
if File.exist?(RESOURCE_MEASURETESTS_PATH)
# load test files from file.
full_file_list = FileList.new(File.readlines(RESOURCE_MEASURETESTS_PATH).map(&:chomp))
full_file_list.select! { |item| item.include?('rb') && File.exist?(item) }
p full_file_list
end
t.test_files = full_file_list.select do |file|
begin
# Try to load the file to check for syntax errors
load file
true
rescue Exception => e
puts "Error in #{file}: #{e.message}"
Minitest::Reporters.reporter.report_error(file, e)
false
end
end
p(full_file_list)
t.verbose = false
t.warning = false
end
end