Add Barrier build test
This commit is contained in:
parent
319432bc61
commit
a3d739c472
@ -3545,4 +3545,16 @@ test "supports building LLVM assembly files with the Program builder in direct m
|
|||||||
expect_match(`./llvmtest.exe`, /hello again/)
|
expect_match(`./llvmtest.exe`, /hello again/)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
test "supports a Barrier builder to order builds" do
|
||||||
|
test_dir "simple"
|
||||||
|
result = run_rscons(args: %w[-f barrier_builder.rb])
|
||||||
|
expect_eq(result.stderr, "")
|
||||||
|
expect_eq(result.status, 0)
|
||||||
|
slines = lines(result.stdout)
|
||||||
|
expect_eq(slines.size, 3)
|
||||||
|
expect_match(slines[0], /B:t/)
|
||||||
|
expect_match(slines[1], /B:t/)
|
||||||
|
expect_match(slines[2], /B:one/)
|
||||||
|
end
|
||||||
|
|
||||||
run_tests
|
run_tests
|
||||||
|
|||||||
15
build_tests/simple/barrier_builder.rb
Normal file
15
build_tests/simple/barrier_builder.rb
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
class B < Builder
|
||||||
|
def run(*args)
|
||||||
|
puts "B:#{@target}"
|
||||||
|
true
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
env do |env|
|
||||||
|
env.add_builder(B)
|
||||||
|
env.B("one")
|
||||||
|
env.B("two")
|
||||||
|
env.B("three")
|
||||||
|
env.Barrier(:bar, %w[two three])
|
||||||
|
env.depends("one", :bar)
|
||||||
|
end
|
||||||
Loading…
x
Reference in New Issue
Block a user