test tracking object file source language - #87

This commit is contained in:
Josh Holtrop 2019-04-09 19:52:25 -04:00
parent 3b00016278
commit 568b78e2e2
3 changed files with 30 additions and 0 deletions

View File

@ -0,0 +1,7 @@
build do
Environment.new(echo: :command) do |env|
env.Object("main.o", "main.d")
env.Object("mod.o", "mod.d")
env.Program("hello-d.exe", ["main.o", "mod.o"])
end
end

View File

@ -0,0 +1,6 @@
build do
Environment.new do |env|
env.Object("simple.o", "simple.cc")
env.Program("simple.exe", "simple.o")
end
end

View File

@ -395,6 +395,14 @@ EOF
expect(`./simple.exe`).to eq "This is a simple C++ program\n"
end
it "links with the C++ linker when object files were built from C++ sources" do
test_dir("simple_cc")
result = run_rscons(rsconscript: "link_objects.rb")
expect(result.stderr).to eq ""
expect(File.exists?("simple.o")).to be_truthy
expect(`./simple.exe`).to eq "This is a simple C++ program\n"
end
it 'allows overriding construction variables for individual builder calls' do
test_dir('two_sources')
result = run_rscons
@ -484,6 +492,15 @@ EOF
expect(`./hello-d.exe`.rstrip).to eq "Hello from D, value is 42!"
end
it "links with the D linker when object files were built from D sources" do
test_dir("d")
result = run_rscons(rsconscript: "link_objects.rb")
expect(result.stderr).to eq ""
expect(File.exists?("main.o")).to be_truthy
expect(File.exists?("mod.o")).to be_truthy
expect(`./hello-d.exe`.rstrip).to eq "Hello from D, value is 42!"
end
it "does dependency generation for D sources" do
test_dir("d")
result = run_rscons