Add Barrier build test

This commit is contained in:
Josh Holtrop 2026-01-28 08:35:01 -05:00
parent 319432bc61
commit a3d739c472
2 changed files with 27 additions and 0 deletions

View File

@ -3545,4 +3545,16 @@ test "supports building LLVM assembly files with the Program builder in direct m
expect_match(`./llvmtest.exe`, /hello again/)
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

View 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