lib/testr/config.rb in testr-14.1.3 vs lib/testr/config.rb in testr-14.2.0
- old
+ new
@@ -3,10 +3,14 @@
module TestR
_user_config_file = '.testr.rb'
Config = OpenStruct.new
+ #---------------------------------------------------------------------------
+ # defaults
+ #---------------------------------------------------------------------------
+
Config.max_forked_workers = [
# http://stackoverflow.com/questions/891537#6420817
'fgrep -c processor /proc/cpuinfo', # Linux
'sysctl -n hw.ncpu', # BSD
'hwprefs cpu_count', # Darwin 9
@@ -58,8 +62,22 @@
test_names.each {|name| ARGV.push '--example', name }
end
end
end
]
+
+ #---------------------------------------------------------------------------
+ # overrides
+ #---------------------------------------------------------------------------
+
+ if ENV.key? 'TESTR_CONFIGS'
+ JSON.load(ENV['TESTR_CONFIGS']).each do |config|
+ if File.exist? config
+ load File.expand_path(config)
+ else
+ require "testr/config/#{config}"
+ end
+ end
+ end
load _user_config_file if File.exist? _user_config_file
end