implement ConfigureOp#check_d_compiler

This commit is contained in:
josh committed 2018-11-07 19:05:08 -05:00
1 parent d54d363a25
commit d656df5407
5 files changed
+96

No files matched your search

+34
View File
@@ -1568,6 +1568,40 @@ EOF
end
end
end
context "check_d_compiler" do
{"check_d_compiler.rb" => "when no arguments are given",
"check_d_compiler_find_first.rb" => "when arguments are given"}.each_pair do |rsconsfile, desc|
context desc do
it "finds the first listed D compiler" do
test_dir "configure"
result = run_rscons(rsconsfile: rsconsfile, op: "configure")
expect(result.stderr).to eq ""
expect(result.status).to eq 0
expect(result.stdout).to match /Checking for D compiler\.\.\. gdc/
end
it "finds the second listed D compiler" do
test_dir "configure"
create_exe "gdc", "exit 1"
result = run_rscons(rsconsfile: rsconsfile, op: "configure")
expect(result.stderr).to eq ""
expect(result.status).to eq 0
expect(result.stdout).to match /Checking for D compiler\.\.\. ldc2/
end
it "fails to configure when it cannot find a D compiler" do
test_dir "configure"
create_exe "gdc", "exit 1"
create_exe "ldc2", "exit 1"
result = run_rscons(rsconsfile: rsconsfile, op: "configure")
expect(result.stderr).to eq ""
expect(result.status).to_not eq 0
expect(result.stdout).to match /Checking for D compiler\.\.\. not found/
end
end
end
end
end
end