add configure specs to check for unknown compiler names

This commit is contained in:
Josh Holtrop 2018-11-29 20:51:24 -05:00
parent 8d7fd4bda8
commit ba5377a1ce
4 changed files with 45 additions and 0 deletions

View File

@ -0,0 +1,3 @@
configure do
check_c_compiler "mycompiler"
end

View File

@ -0,0 +1,3 @@
configure do
check_cxx_compiler "mycompiler"
end

View File

@ -0,0 +1,3 @@
configure do
check_d_compiler "mycompiler"
end

View File

@ -1566,6 +1566,15 @@ EOF
end end
end end
end end
it "successfully tests a compiler with an unknown name" do
test_dir "configure"
create_exe "mycompiler", %[exec gcc "$@"]
result = run_rscons(rsconscript: "check_c_compiler_custom.rb", op: "configure")
expect(result.stderr).to eq ""
expect(result.status).to eq 0
expect(result.stdout).to match /Checking for C compiler\.\.\. mycompiler/
end
end end
context "check_cxx_compiler" do context "check_cxx_compiler" do
@ -1600,6 +1609,15 @@ EOF
end end
end end
end end
it "successfully tests a compiler with an unknown name" do
test_dir "configure"
create_exe "mycompiler", %[exec clang++ "$@"]
result = run_rscons(rsconscript: "check_cxx_compiler_custom.rb", op: "configure")
expect(result.stderr).to eq ""
expect(result.status).to eq 0
expect(result.stdout).to match /Checking for C\+\+ compiler\.\.\. mycompiler/
end
end end
context "check_d_compiler" do context "check_d_compiler" do
@ -1634,6 +1652,24 @@ EOF
end end
end end
end end
it "successfully tests a compiler with an unknown name that uses gdc-compatible options" do
test_dir "configure"
create_exe "mycompiler", %[exec gdc "$@"]
result = run_rscons(rsconscript: "check_d_compiler_custom.rb", op: "configure")
expect(result.stderr).to eq ""
expect(result.status).to eq 0
expect(result.stdout).to match /Checking for D compiler\.\.\. mycompiler/
end
it "successfully tests a compiler with an unknown name that uses ldc2-compatible options" do
test_dir "configure"
create_exe "mycompiler", %[exec ldc2 "$@"]
result = run_rscons(rsconscript: "check_d_compiler_custom.rb", op: "configure")
expect(result.stderr).to eq ""
expect(result.status).to eq 0
expect(result.stdout).to match /Checking for D compiler\.\.\. mycompiler/
end
end end
context "check_c_header" do context "check_c_header" do