Test that custom clean task action blocks are execution

This commit is contained in:
Josh Holtrop 2022-02-28 11:59:17 -05:00
parent ecd91e1171
commit b068fe7574
2 changed files with 18 additions and 0 deletions

View File

@ -0,0 +1,7 @@
env do |env|
env.Program('simple.exe', Dir['*.c'])
end
clean do
puts "custom clean action"
end

View File

@ -372,6 +372,17 @@ EOF
expect(File.exists?('simple.c')).to be_truthy
end
it "executes custom clean action blocks" do
test_dir("simple")
result = run_rscons(args: %w[-f clean.rb])
expect(result.stderr).to eq ""
expect(File.exists?("build/e.1/simple.c.o")).to be_truthy
result = run_rscons(args: %w[-f clean.rb clean])
expect(result.stderr).to eq ""
expect(result.stdout).to match %r{custom clean action}
expect(File.exists?("build/e.1/simple.c.o")).to be_falsey
end
it "does not process environments" do
test_dir("simple")
result = run_rscons(args: %w[clean])