Replace the "SKIP" mechanism with a more general "REQUIRE" that can

evaluate arbitrary Ruby code to decide if a test should be run.
This commit is contained in:
Johan Holmberg 2009-03-26 21:44:10 +00:00 committed by holmberg556
parent e2ead001b9
commit f6d21b9092

View File

@ -286,10 +286,11 @@ for prefix, code, stdout in tests
next
end
if code.join("\n") =~ /SKIP \s+ (\S+)/x
skip = $1
if RUBY_PLATFORM.index(skip)
puts "### #{iii}: SKIP: %s ..." % [code[0].chomp]
code_str = code.join("\n")
if code_str =~ /REQUIRE: \s+ (.*)/x
expr = $1
if ! eval(expr)
puts "### #{iii}: SKIP: %s: %s ..." % [expr, code[0].chomp]
act.add(prefix, code, stdout)
next
end