add build test for D

This commit is contained in:
Josh Holtrop 2013-11-05 16:29:15 -05:00
parent cc2c2733fc
commit 30564af558
2 changed files with 20 additions and 0 deletions

6
build_tests/d/main.d Normal file
View File

@ -0,0 +1,6 @@
import std.stdio;
void main()
{
writeln("Hello from D!");
}

View File

@ -304,4 +304,18 @@ EOF
'gcc -o tweaker build_one/one.o build_two/two.o', 'gcc -o tweaker build_one/one.o build_two/two.o',
] ]
end end
unless ENV["omit_gdc_tests"]
it "supports building D sources" do
test_dir("d")
Rscons::Environment.new do |env|
env.Program("hello-d", Dir["*.d"])
end
lines.should == [
"gdc -c -o main.o main.d",
"gdc -o hello-d main.o",
]
`./hello-d`.rstrip.should == "Hello from D!"
end
end
end end