Kouhei Sutou
null+****@clear*****
Wed Jun 1 15:14:11 JST 2016
Kouhei Sutou 2016-06-01 15:14:11 +0900 (Wed, 01 Jun 2016) New Revision: e9c326120f9f1b6216ebae63f3b9c6131c6f2f17 https://github.com/groonga/grntest/commit/e9c326120f9f1b6216ebae63f3b9c6131c6f2f17 Message: Support expanding variables in environment variable Modified files: lib/grntest/test-runner.rb Modified: lib/grntest/test-runner.rb (+5 -4) =================================================================== --- lib/grntest/test-runner.rb 2016-06-01 15:13:51 +0900 (c668af2) +++ lib/grntest/test-runner.rb 2016-06-01 15:14:11 +0900 (0dec46e) @@ -194,7 +194,7 @@ module Grntest groonga_input = input_write groonga_output = output_read - env = extract_custom_env + env = extract_custom_env(context) spawn_options = {} command_line = groonga_command_line(context, spawn_options) if Platform.windows? @@ -460,7 +460,7 @@ events { } GLOBAL - env = ENV.to_hash.merge(extract_custom_env) + env = ENV.to_hash.merge(extract_custom_env(context)) env.each do |key, value| next unless key.start_with?("GRN_") config_file.puts(<<-ENV) @@ -670,15 +670,16 @@ http { @worker.test_script_path end - def extract_custom_env + def extract_custom_env(context) return {} unless test_script_path.exist? env = {} test_script_path.open("r:ascii-8bit") do |script_file| + expander = VariableExpander.new(context) script_file.each_line do |line| case line when /\A\#\$([a-zA-Z_\d]+)=(.*)/ - env[$1] = $2.strip + env[$1] = expander.expand($2.strip) end end end -------------- next part -------------- HTML����������������������������... Download