cloned Environments should inherit n_threads - close #42
This commit is contained in:
parent
2a96495e83
commit
775363ddbd
7
build_tests/simple/clone_n_threads.rb
Normal file
7
build_tests/simple/clone_n_threads.rb
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
base_env = Rscons::Environment.new do |env|
|
||||||
|
env.n_threads = 165
|
||||||
|
end
|
||||||
|
|
||||||
|
my_env = base_env.clone
|
||||||
|
|
||||||
|
puts my_env.n_threads
|
@ -118,6 +118,7 @@ module Rscons
|
|||||||
env.add_post_build_hook(&build_hook_block)
|
env.add_post_build_hook(&build_hook_block)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
env.instance_variable_set(:@n_threads, @n_threads)
|
||||||
|
|
||||||
if block_given?
|
if block_given?
|
||||||
yield env
|
yield env
|
||||||
|
@ -762,6 +762,13 @@ EOF
|
|||||||
expect(result.stderr).to match /Failed to build foo_4/
|
expect(result.stderr).to match /Failed to build foo_4/
|
||||||
end
|
end
|
||||||
|
|
||||||
|
it "clones n_threads attribute when cloning an Environment" do
|
||||||
|
test_dir("simple")
|
||||||
|
result = run_test(rsconsfile: "clone_n_threads.rb")
|
||||||
|
expect(result.stderr).to eq ""
|
||||||
|
expect(lines(result.stdout)).to eq ["165"]
|
||||||
|
end
|
||||||
|
|
||||||
context "backward compatibility" do
|
context "backward compatibility" do
|
||||||
it "allows a builder to call Environment#run_builder in a non-threaded manner" do
|
it "allows a builder to call Environment#run_builder in a non-threaded manner" do
|
||||||
test_dir("simple")
|
test_dir("simple")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user