@@ -266,7 +266,11 @@ def mpi?
266266 end
267267
268268 def valgrind?
269- ! FormTest.cfg.valgrind.nil?
269+ if FormTest.cfg.fake_valgrind.nil?
270+ ! FormTest.cfg.valgrind.nil?
271+ else
272+ FormTest.cfg.fake_valgrind
273+ end
270274 end
271275
272276 def wordsize
@@ -1147,12 +1151,13 @@ def delete(classname)
11471151
11481152# FORM configuration.
11491153class FormConfig
1150- def initialize(form, mpirun, mpirun_opts, valgrind, valgrind_opts, wordsize, ncpu, timeout, retries, stat, full, verbose, show_newlines)
1154+ def initialize(form, mpirun, mpirun_opts, valgrind, valgrind_opts, fake_valgrind, wordsize, ncpu, timeout, retries, stat, full, verbose, show_newlines)
11511155 @form = form
11521156 @mpirun = mpirun
11531157 @mpirun_opts = mpirun_opts
11541158 @valgrind = valgrind
11551159 @valgrind_opts = valgrind_opts
1160+ @fake_valgrind = fake_valgrind
11561161 @ncpu = ncpu
11571162 @timeout = timeout
11581163 @retries = retries
@@ -1174,7 +1179,7 @@ def initialize(form, mpirun, mpirun_opts, valgrind, valgrind_opts, wordsize, ncp
11741179 @form_cmd = nil
11751180 end
11761181
1177- attr_reader :form, :mpirun, :mpirun_opts, :valgrind, :valgrind_opts, :ncpu, :timeout, :retries, :stat, :full, :verbose, :show_newlines,
1182+ attr_reader :form, :mpirun, :mpirun_opts, :valgrind, :valgrind_opts, :fake_valgrind, : ncpu, :timeout, :retries, :stat, :full, :verbose, :show_newlines,
11781183 :form_bin, :mpirun_bin, :valgrind_bin, :valgrind_supp, :head, :wordsize, :form_cmd
11791184
11801185 def serial?
@@ -1446,6 +1451,7 @@ def main
14461451 opts.enable_valgrind = false
14471452 opts.valgrind = "valgrind"
14481453 opts.valgrind_opts = nil
1454+ opts.fake_valgrind = nil
14491455 opts.wordsize = nil
14501456 opts.dir = nil
14511457 opts.name_patterns = []
@@ -1482,6 +1488,10 @@ def main
14821488 "Full test, ignoring pending") { opts.full = true }
14831489 parser.on("--enable-valgrind",
14841490 "Enable Valgrind") { opts.enable_valgrind = true }
1491+ parser.on("--fake-valgrind",
1492+ "Pretend to run under Valgrind") { opts.fake_valgrind = true }
1493+ parser.on("--fake-no-valgrind",
1494+ "Pretend not to run under Valgrind") { opts.fake_valgrind = false }
14851495 parser.on("--valgrind BIN",
14861496 "Use BIN as Valgrind executable") { |bin| opts.enable_valgrind = true; opts.valgrind = bin }
14871497 parser.on("--valgrind-opts OPTS",
@@ -1624,6 +1634,7 @@ def main
16241634 opts.mpirun_opts,
16251635 opts.enable_valgrind ? opts.valgrind : nil,
16261636 opts.valgrind_opts,
1637+ opts.fake_valgrind,
16271638 opts.wordsize,
16281639 opts.ncpu,
16291640 [opts.timeout, 1].max,
0 commit comments