32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
|
# File 'lib/oats/roptions.rb', line 32
def Roptions.override(options={})
oats_data = $oats
oats_lib = Util.expand_path(File.dirname(__FILE__)+'/..')
oats_data['_']['oats_lib'] = oats_lib
options.each do |key,val|
data_keys = key.split(':')
v = oats_data
key_var = nil
loop do
key_var = data_keys.shift
break if data_keys.empty? or key_var == '_'
v = v[key_var]
end
next if key_var == '_'
if val.instance_of?(Array)
val_str = val.join(',')
else
val_str = val.to_s
end
vval = v[key_var]
if vval.instance_of?(Array)
vval_str = vval.join(',')
else
vval_str = vval.to_s
end
$log.info "Option #{key.inspect} specified as: #{val_str.inspect} is overriding #{vval_str.inspect}"\
unless $oats_execution['agent']
v[key_var] = val
end
level = Log4r::Log4rConfig::LogLevels.index(oats_data['execution']['log_level'])
raise(OatsBadInput, "Unrecognized execution:log_level [#{oats_data['execution']['log_level']}]") unless level
$log.level = level = 1 if $log
raise(OatsBadInput,"Must specify execution:dir_results") unless oats_data['execution']['dir_results']
oats_data['_']['vendor'] = Util.expand_path('../vendor',oats_lib)
oats_data['selenium']['ide']['result_browser'] = oats_data['selenium']['ide']['result_browser']
oats_data['selenium']['ide']['show_result'] = 0 unless oats_data['selenium']['ide']['show_result']
unless oats_data['selenium']['pause_on_exit']
if oats_data['execution']['test_files'] and oats_data['execution']['test_files'].first =~ /\.yml/
oats_data['selenium']['pause_on_exit'] = 0
else
oats_data['selenium']['pause_on_exit'] = 1
end
end
return options
end
|