Method: Minitest::TestTask#process_env

Defined in:
lib/minitest/test_task.rb

#process_envObject

Extract variables from the environment and convert them to command line arguments. See #extra_args.

Environment Variables:

MT_LIB_EXTRAS

Extra libs to dynamically override/inject for custom runs.

N

Tests to run (string or /regexp/).

X

Tests to exclude (string or /regexp/).

A

Any extra arguments. Honors shell quoting.

Deprecated:

TESTOPTS

For argument passing, use A.

N

For parallel testing, use MT_CPU.

FILTER

Same as TESTOPTS.

[View source]

138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
# File 'lib/minitest/test_task.rb', line 138

def process_env
  warn "TESTOPTS is deprecated in Minitest::TestTask. Use A instead" if
    ENV["TESTOPTS"]
  warn "FILTER is deprecated in Minitest::TestTask. Use A instead" if
    ENV["FILTER"]
  warn "N is deprecated in Minitest::TestTask. Use MT_CPU instead" if
    ENV["N"] && ENV["N"].to_i > 0

  lib_extras = (ENV["MT_LIB_EXTRAS"] || "").split File::PATH_SEPARATOR
  self.libs[0,0] = lib_extras

  extra_args << "-n" << ENV["N"]                      if ENV["N"]
  extra_args << "-e" << ENV["X"]                      if ENV["X"]
  extra_args.concat Shellwords.split(ENV["TESTOPTS"]) if ENV["TESTOPTS"]
  extra_args.concat Shellwords.split(ENV["FILTER"])   if ENV["FILTER"]
  extra_args.concat Shellwords.split(ENV["A"])        if ENV["A"]

  ENV.delete "N" if ENV["N"]

  # TODO? RUBY_DEBUG = ENV["RUBY_DEBUG"]
  # TODO? ENV["RUBY_FLAGS"]

  extra_args.compact!
end