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:
parent
e2ead001b9
commit
f6d21b9092
@ -286,10 +286,11 @@ for prefix, code, stdout in tests
|
|||||||
next
|
next
|
||||||
end
|
end
|
||||||
|
|
||||||
if code.join("\n") =~ /SKIP \s+ (\S+)/x
|
code_str = code.join("\n")
|
||||||
skip = $1
|
if code_str =~ /REQUIRE: \s+ (.*)/x
|
||||||
if RUBY_PLATFORM.index(skip)
|
expr = $1
|
||||||
puts "### #{iii}: SKIP: %s ..." % [code[0].chomp]
|
if ! eval(expr)
|
||||||
|
puts "### #{iii}: SKIP: %s: %s ..." % [expr, code[0].chomp]
|
||||||
act.add(prefix, code, stdout)
|
act.add(prefix, code, stdout)
|
||||||
next
|
next
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user