Class: RunAllTests

Inherits:
Minitest::Test
  • Object
show all
Defined in:
lib/openstudio-standards/btap/costing/test_run_all_test_locally.rb

Instance Method Summary collapse

Instance Method Details

#test_allObject



10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/openstudio-standards/btap/costing/test_run_all_test_locally.rb', line 10

def test_all()
  full_file_list = nil
  test_list_file = File.expand_path(File.join(__dir__, 'test_list.txt'))
  root_dir       = File.expand_path("../../../../", __dir__)
  if File.exist?(test_list_file)
    puts test_list_file
    # load test files from file.

    full_file_list = File.readlines(test_list_file).shuffle
    full_file_list.map! {|file| "#{root_dir}/#{file.strip}"}
    # Select only .rb files that exist

    full_file_list.select! {|file| file.include?('rb') && File.exist?(file)}
  else
    puts "Could not find list of files to test at #{test_list_file}"
    return false
  end
  assert(ParallelTests.new.run(full_file_list), "Some tests failed please ensure all test pass and tests have been updated to reflect the changes you expect before issuing a pull request")
end