rscons/build_tests/simple/threading.rb
Josh Holtrop f8e6666a2c Add 'build' DSL method.
Disallow processing Environments until configuration is performed.
2018-12-17 22:14:35 -05:00

31 lines
716 B
Ruby

class ThreadedTestBuilder < Rscons::Builder
def run(options)
command = ["ruby", "-e", %[sleep 1]]
Rscons::ThreadedCommand.new(
command,
short_description: "ThreadedTestBuilder #{options[:target]}")
end
def finalize(options)
true
end
end
class NonThreadedTestBuilder < Rscons::Builder
def run(options)
puts "NonThreadedTestBuilder #{options[:target]}"
sleep 1
options[:target]
end
end
build do
Rscons::Environment.new do |env|
env.add_builder(ThreadedTestBuilder.new)
env.add_builder(NonThreadedTestBuilder.new)
env.ThreadedTestBuilder("a")
env.ThreadedTestBuilder("b")
env.ThreadedTestBuilder("c")
env.NonThreadedTestBuilder("d")
end
end