From 30564af55826fe42c41351a1b6f5aec6195fabab Mon Sep 17 00:00:00 2001 From: Josh Holtrop Date: Tue, 5 Nov 2013 16:29:15 -0500 Subject: [PATCH] add build test for D --- build_tests/d/main.d | 6 ++++++ spec/build_tests_spec.rb | 14 ++++++++++++++ 2 files changed, 20 insertions(+) create mode 100644 build_tests/d/main.d diff --git a/build_tests/d/main.d b/build_tests/d/main.d new file mode 100644 index 0000000..2d78b0b --- /dev/null +++ b/build_tests/d/main.d @@ -0,0 +1,6 @@ +import std.stdio; + +void main() +{ + writeln("Hello from D!"); +} diff --git a/spec/build_tests_spec.rb b/spec/build_tests_spec.rb index 14b1ab5..7150469 100644 --- a/spec/build_tests_spec.rb +++ b/spec/build_tests_spec.rb @@ -304,4 +304,18 @@ EOF 'gcc -o tweaker build_one/one.o build_two/two.o', ] 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