diff --git a/build_tests/configure/check_c_compiler_custom.rb b/build_tests/configure/check_c_compiler_custom.rb new file mode 100644 index 0000000..8411a19 --- /dev/null +++ b/build_tests/configure/check_c_compiler_custom.rb @@ -0,0 +1,3 @@ +configure do + check_c_compiler "mycompiler" +end diff --git a/build_tests/configure/check_cxx_compiler_custom.rb b/build_tests/configure/check_cxx_compiler_custom.rb new file mode 100644 index 0000000..386e5d5 --- /dev/null +++ b/build_tests/configure/check_cxx_compiler_custom.rb @@ -0,0 +1,3 @@ +configure do + check_cxx_compiler "mycompiler" +end diff --git a/build_tests/configure/check_d_compiler_custom.rb b/build_tests/configure/check_d_compiler_custom.rb new file mode 100644 index 0000000..b7f0138 --- /dev/null +++ b/build_tests/configure/check_d_compiler_custom.rb @@ -0,0 +1,3 @@ +configure do + check_d_compiler "mycompiler" +end diff --git a/spec/build_tests_spec.rb b/spec/build_tests_spec.rb index 28491d7..61ec08b 100644 --- a/spec/build_tests_spec.rb +++ b/spec/build_tests_spec.rb @@ -1566,6 +1566,15 @@ EOF 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 context "check_cxx_compiler" do @@ -1600,6 +1609,15 @@ EOF 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 context "check_d_compiler" do @@ -1634,6 +1652,24 @@ EOF 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 context "check_c_header" do