add spec for building a shared library using D
This commit is contained in:
parent
db2ec82a25
commit
10d4c647b9
9
build_tests/shared_library/shared_library_d.rb
Normal file
9
build_tests/shared_library/shared_library_d.rb
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
Rscons::Environment.new do |env|
|
||||||
|
env["CPPPATH"] << "src/lib"
|
||||||
|
libmine = env.SharedLibrary("libmine", Dir["src/lib/*.d"])
|
||||||
|
env.Program("test-shared.exe",
|
||||||
|
Dir["src/*.c"],
|
||||||
|
"LIBPATH" => %w[.],
|
||||||
|
"LIBS" => %w[mine])
|
||||||
|
env.build_after("test-shared.exe", libmine.to_s)
|
||||||
|
end
|
6
build_tests/shared_library/src/lib/one.d
Normal file
6
build_tests/shared_library/src/lib/one.d
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
import core.stdc.stdio;
|
||||||
|
|
||||||
|
extern (C) void one()
|
||||||
|
{
|
||||||
|
printf("Hi from one()\n");
|
||||||
|
}
|
6
build_tests/shared_library/src/lib/two.d
Normal file
6
build_tests/shared_library/src/lib/two.d
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
import core.stdc.stdio;
|
||||||
|
|
||||||
|
extern (C) void two()
|
||||||
|
{
|
||||||
|
printf("Hi from two()\n");
|
||||||
|
}
|
@ -435,6 +435,19 @@ EOF
|
|||||||
]
|
]
|
||||||
expect(`./hello-d.exe`.rstrip).to eq "Hello from D!"
|
expect(`./hello-d.exe`.rstrip).to eq "Hello from D!"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
it "creates shared libraries using D" do
|
||||||
|
test_dir("shared_library")
|
||||||
|
|
||||||
|
result = run_test(rsconsfile: "shared_library_d.rb")
|
||||||
|
# Currently gdc produces an error while trying to build the shared
|
||||||
|
# library. Since this isn't really an rscons problem, I'm commenting out
|
||||||
|
# this check. I'm not sure what I want to do about D support at this
|
||||||
|
# point anyway...
|
||||||
|
#expect(result.stderr).to eq ""
|
||||||
|
slines = lines(result.stdout)
|
||||||
|
expect(slines).to include("SHLD libmine.so")
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
it "supports disassembling object files" do
|
it "supports disassembling object files" do
|
||||||
|
Loading…
x
Reference in New Issue
Block a user