add multi-threading build test
This commit is contained in:
1 parent
15e5d15424
commit
2ffdf82d9a
2 files changed
+45
No files matched your search
@@ -0,0 +1,28 @@
|
||||
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
|
||||
|
||||
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
|
||||
Reference in new issue
Block a user