convert Library builder specs to integration tests
This commit is contained in:
parent
7e707e7e3b
commit
957fd8c86d
4
build_tests/library/override_arcmd.rb
Normal file
4
build_tests/library/override_arcmd.rb
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
Rscons::Environment.new(echo: :command) do |env|
|
||||||
|
env["ARCMD"] = %w[ar rcf ${_TARGET} ${_SOURCES}]
|
||||||
|
env.Library("lib.a", Dir["*.c"].sort)
|
||||||
|
end
|
@ -960,4 +960,13 @@ EOF
|
|||||||
expect(result.stderr).to match /unknown input file type: "foo.xyz"/
|
expect(result.stderr).to match /unknown input file type: "foo.xyz"/
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
context "Library builder" do
|
||||||
|
it "allows overriding ARCMD construction variable" do
|
||||||
|
test_dir("library")
|
||||||
|
result = run_test(rsconsfile: "override_arcmd.rb")
|
||||||
|
expect(result.stderr).to eq ""
|
||||||
|
expect(lines(result.stdout)).to include "ar rcf lib.a one.o three.o two.o"
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
@ -1,28 +0,0 @@
|
|||||||
module Rscons
|
|
||||||
module Builders
|
|
||||||
describe Library do
|
|
||||||
let(:env) {Environment.new}
|
|
||||||
subject {Library.new}
|
|
||||||
|
|
||||||
it "supports overriding AR construction variable" do
|
|
||||||
expect(subject).to receive(:standard_build).with("AR prog.a", "prog.a", ["sp-ar", "rcs", "prog.a", "prog.o"], ["prog.o"], env, :cache)
|
|
||||||
subject.run(
|
|
||||||
target: "prog.a",
|
|
||||||
sources: ["prog.o"],
|
|
||||||
cache: :cache,
|
|
||||||
env: env,
|
|
||||||
vars: {"AR" => "sp-ar"})
|
|
||||||
end
|
|
||||||
|
|
||||||
it "supports overriding ARCMD construction variable" do
|
|
||||||
expect(subject).to receive(:standard_build).with("AR prog.a", "prog.a", ["special", "AR!", "prog.o"], ["prog.o"], env, :cache)
|
|
||||||
subject.run(
|
|
||||||
target: "prog.a",
|
|
||||||
sources: ["prog.o"],
|
|
||||||
cache: :cache,
|
|
||||||
env: env,
|
|
||||||
vars: {"ARCMD" => ["special", "AR!", "${_SOURCES}"]})
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
Loading…
x
Reference in New Issue
Block a user