diff --git a/spec/build_tests_spec.rb b/spec/build_tests_spec.rb index 8b61993..659ff90 100644 --- a/spec/build_tests_spec.rb +++ b/spec/build_tests_spec.rb @@ -1840,7 +1840,7 @@ EOF it "successfully tests a compiler with an unknown name" do test_dir "configure" create_exe "mycompiler", %[exec gcc "$@"] - result = run_rscons(args: %w[-f check_c_compiler_custom.rb", args: "configure]) + result = run_rscons(args: %w[-f check_c_compiler_custom.rb configure]) expect(result.stderr).to eq "" expect(result.status).to eq 0 expect(result.stdout).to match /Checking for C compiler\.\.\. mycompiler/ @@ -1883,7 +1883,7 @@ EOF it "successfully tests a compiler with an unknown name" do test_dir "configure" create_exe "mycompiler", %[exec clang++ "$@"] - result = run_rscons(args: %w[-f check_cxx_compiler_custom.rb", args: "configure]) + result = run_rscons(args: %w[-f check_cxx_compiler_custom.rb configure]) expect(result.stderr).to eq "" expect(result.status).to eq 0 expect(result.stdout).to match /Checking for C\+\+ compiler\.\.\. mycompiler/ @@ -1929,7 +1929,7 @@ EOF 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(args: %w[-f check_d_compiler_custom.rb", args: "configure]) + result = run_rscons(args: %w[-f check_d_compiler_custom.rb configure]) expect(result.stderr).to eq "" expect(result.status).to eq 0 expect(result.stdout).to match /Checking for D compiler\.\.\. mycompiler/ @@ -1939,7 +1939,7 @@ EOF 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(args: %w[-f check_d_compiler_custom.rb", args: "configure]) + result = run_rscons(args: %w[-f check_d_compiler_custom.rb configure]) expect(result.stderr).to eq "" expect(result.status).to eq 0 expect(result.stdout).to match /Checking for D compiler\.\.\. mycompiler/ @@ -1949,7 +1949,7 @@ EOF context "check_c_header" do it "succeeds when the requested header is found" do test_dir "configure" - result = run_rscons(args: %w[-f check_c_header_success.rb", args: "configure]) + result = run_rscons(args: %w[-f check_c_header_success.rb configure]) expect(result.stderr).to eq "" expect(result.status).to eq 0 expect(result.stdout).to match /Checking for C header 'string\.h'... found/ @@ -1957,7 +1957,7 @@ EOF it "fails when the requested header is not found" do test_dir "configure" - result = run_rscons(args: %w[-f check_c_header_failure.rb", args: "configure]) + result = run_rscons(args: %w[-f check_c_header_failure.rb configure]) expect(result.stderr).to match /Configuration failed/ expect(result.status).to_not eq 0 expect(result.stdout).to match /Checking for C header 'not___found\.h'... not found/ @@ -1965,7 +1965,7 @@ EOF it "succeeds when the requested header is not found but :fail is set to false" do test_dir "configure" - result = run_rscons(args: %w[-f check_c_header_no_fail.rb", args: "configure]) + result = run_rscons(args: %w[-f check_c_header_no_fail.rb configure]) expect(result.stderr).to eq "" expect(result.status).to eq 0 expect(result.stdout).to match /Checking for C header 'not___found\.h'... not found/ @@ -1973,11 +1973,11 @@ EOF it "sets the specified define when the header is found" do test_dir "configure" - result = run_rscons(args: %w[-f check_c_header_success_set_define.rb", args: "configure]) + result = run_rscons(args: %w[-f check_c_header_success_set_define.rb configure]) expect(result.stderr).to eq "" expect(result.status).to eq 0 expect(result.stdout).to match /Checking for C header 'string\.h'... found/ - result = run_rscons(args: %w[-f check_c_header_success_set_define.rb", args: "build]) + result = run_rscons(args: %w[-f check_c_header_success_set_define.rb]) expect(result.stderr).to eq "" expect(result.status).to eq 0 expect(result.stdout).to match /-DHAVE_STRING_H/ @@ -1985,11 +1985,11 @@ EOF it "does not set the specified define when the header is not found" do test_dir "configure" - result = run_rscons(args: %w[-f check_c_header_no_fail_set_define.rb", args: "configure]) + result = run_rscons(args: %w[-f check_c_header_no_fail_set_define.rb configure]) expect(result.stderr).to eq "" expect(result.status).to eq 0 expect(result.stdout).to match /Checking for C header 'not___found\.h'... not found/ - result = run_rscons(args: %w[-f check_c_header_no_fail_set_define.rb", args: "build]) + result = run_rscons(args: %w[-f check_c_header_no_fail_set_define.rb]) expect(result.stderr).to eq "" expect(result.status).to eq 0 expect(result.stdout).to_not match /-DHAVE_/ @@ -2002,7 +2002,7 @@ EOF File.open("usr2/frobulous.h", "wb") do |fh| fh.puts("#define FOO 42") end - result = run_rscons(args: %w[-f check_c_header_cpppath.rb", args: "configure]) + result = run_rscons(args: %w[-f check_c_header_cpppath.rb configure]) expect(result.stderr).to eq "" expect(result.status).to eq 0 result = run_rscons(args: %w[-f check_c_header_cpppath.rb -v]) @@ -2014,7 +2014,7 @@ EOF context "check_cxx_header" do it "succeeds when the requested header is found" do test_dir "configure" - result = run_rscons(args: %w[-f check_cxx_header_success.rb", args: "configure]) + result = run_rscons(args: %w[-f check_cxx_header_success.rb configure]) expect(result.stderr).to eq "" expect(result.status).to eq 0 expect(result.stdout).to match /Checking for C\+\+ header 'string\.h'... found/ @@ -2022,7 +2022,7 @@ EOF it "fails when the requested header is not found" do test_dir "configure" - result = run_rscons(args: %w[-f check_cxx_header_failure.rb", args: "configure]) + result = run_rscons(args: %w[-f check_cxx_header_failure.rb configure]) expect(result.stderr).to match /Configuration failed/ expect(result.status).to_not eq 0 expect(result.stdout).to match /Checking for C\+\+ header 'not___found\.h'... not found/ @@ -2030,7 +2030,7 @@ EOF it "succeeds when the requested header is not found but :fail is set to false" do test_dir "configure" - result = run_rscons(args: %w[-f check_cxx_header_no_fail.rb", args: "configure]) + result = run_rscons(args: %w[-f check_cxx_header_no_fail.rb configure]) expect(result.stderr).to eq "" expect(result.status).to eq 0 expect(result.stdout).to match /Checking for C\+\+ header 'not___found\.h'... not found/ @@ -2043,7 +2043,7 @@ EOF File.open("usr2/frobulous.h", "wb") do |fh| fh.puts("#define FOO 42") end - result = run_rscons(args: %w[-f check_cxx_header_cpppath.rb", args: "configure]) + result = run_rscons(args: %w[-f check_cxx_header_cpppath.rb configure]) expect(result.stderr).to eq "" expect(result.status).to eq 0 result = run_rscons(args: %w[-f check_cxx_header_cpppath.rb -v]) @@ -2055,7 +2055,7 @@ EOF context "check_d_import" do it "succeeds when the requested import is found" do test_dir "configure" - result = run_rscons(args: %w[-f check_d_import_success.rb", args: "configure]) + result = run_rscons(args: %w[-f check_d_import_success.rb configure]) expect(result.stderr).to eq "" expect(result.status).to eq 0 expect(result.stdout).to match /Checking for D import 'std\.stdio'... found/ @@ -2063,7 +2063,7 @@ EOF it "fails when the requested import is not found" do test_dir "configure" - result = run_rscons(args: %w[-f check_d_import_failure.rb", args: "configure]) + result = run_rscons(args: %w[-f check_d_import_failure.rb configure]) expect(result.stderr).to match /Configuration failed/ expect(result.status).to_not eq 0 expect(result.stdout).to match /Checking for D import 'not\.found'... not found/ @@ -2071,7 +2071,7 @@ EOF it "succeeds when the requested import is not found but :fail is set to false" do test_dir "configure" - result = run_rscons(args: %w[-f check_d_import_no_fail.rb", args: "configure]) + result = run_rscons(args: %w[-f check_d_import_no_fail.rb configure]) expect(result.stderr).to eq "" expect(result.status).to eq 0 expect(result.stdout).to match /Checking for D import 'not\.found'... not found/ @@ -2084,7 +2084,7 @@ EOF File.open("usr2/frobulous.d", "wb") do |fh| fh.puts("int foo = 42;") end - result = run_rscons(args: %w[-f check_d_import_d_import_path.rb", args: "configure]) + result = run_rscons(args: %w[-f check_d_import_d_import_path.rb configure]) expect(result.stderr).to eq "" expect(result.status).to eq 0 result = run_rscons(args: %w[-f check_d_import_d_import_path.rb -v]) @@ -2096,7 +2096,7 @@ EOF context "check_lib" do it "succeeds when the requested library is found" do test_dir "configure" - result = run_rscons(args: %w[-f check_lib_success.rb", args: "configure]) + result = run_rscons(args: %w[-f check_lib_success.rb configure]) expect(result.stderr).to eq "" expect(result.status).to eq 0 expect(result.stdout).to match /Checking for library 'm'... found/ @@ -2104,7 +2104,7 @@ EOF it "fails when the requested library is not found" do test_dir "configure" - result = run_rscons(args: %w[-f check_lib_failure.rb", args: "configure]) + result = run_rscons(args: %w[-f check_lib_failure.rb configure]) expect(result.stderr).to match /Configuration failed/ expect(result.status).to_not eq 0 expect(result.stdout).to match /Checking for library 'mfoofoo'... not found/ @@ -2112,7 +2112,7 @@ EOF it "succeeds when the requested library is not found but :fail is set to false" do test_dir "configure" - result = run_rscons(args: %w[-f check_lib_no_fail.rb", args: "configure]) + result = run_rscons(args: %w[-f check_lib_no_fail.rb configure]) expect(result.stderr).to eq "" expect(result.status).to eq 0 expect(result.stdout).to match /Checking for library 'mfoofoo'... not found/ @@ -2120,7 +2120,7 @@ EOF it "links against the checked library by default" do test_dir "configure" - result = run_rscons(args: %w[-f check_lib_success.rb", args: "build]) + result = run_rscons(args: %w[-f check_lib_success.rb]) expect(result.stderr).to eq "" expect(result.status).to eq 0 expect(result.stdout).to match /Checking for library 'm'... found/ @@ -2129,7 +2129,7 @@ EOF it "does not link against the checked library by default if :use is specified" do test_dir "configure" - result = run_rscons(args: %w[-f check_lib_use.rb", args: "build]) + result = run_rscons(args: %w[-f check_lib_use.rb]) expect(result.stderr).to eq "" expect(result.status).to eq 0 expect(result.stdout).to match /Checking for library 'm'... found/ @@ -2139,7 +2139,7 @@ EOF it "does not link against the checked library if :use is set to false" do test_dir "configure" - result = run_rscons(args: %w[-f check_lib_use_false.rb", args: "build]) + result = run_rscons(args: %w[-f check_lib_use_false.rb]) expect(result.stderr).to eq "" expect(result.status).to eq 0 expect(result.stdout).to match /Checking for library 'm'... found/ @@ -2153,7 +2153,7 @@ EOF result = run_rscons(args: %w[-f check_lib_libpath1.rb]) expect(result.stderr).to eq "" expect(result.status).to eq 0 - result = run_rscons(args: %w[-f check_lib_libpath2.rb", args: "configure]) + result = run_rscons(args: %w[-f check_lib_libpath2.rb configure]) expect(result.stderr).to eq "" expect(result.status).to eq 0 result = run_rscons(args: %w[-f check_lib_libpath2.rb]) @@ -2167,7 +2167,7 @@ EOF context "check_program" do it "succeeds when the requested program is found" do test_dir "configure" - result = run_rscons(args: %w[-f check_program_success.rb", args: "configure]) + result = run_rscons(args: %w[-f check_program_success.rb configure]) expect(result.stderr).to eq "" expect(result.status).to eq 0 expect(result.stdout).to match /Checking for program 'find'... .*find/ @@ -2176,7 +2176,7 @@ EOF context "with non-existent PATH entries" do it "succeeds when the requested program is found" do test_dir "configure" - result = run_rscons(args: %w[-f check_program_success.rb", args: "configure", path: "/foo/bar]) + result = run_rscons(args: %w[-f check_program_success.rb configure], path: "/foo/bar") expect(result.stderr).to eq "" expect(result.status).to eq 0 expect(result.stdout).to match /Checking for program 'find'... .*find/ @@ -2185,7 +2185,7 @@ EOF it "fails when the requested program is not found" do test_dir "configure" - result = run_rscons(args: %w[-f check_program_failure.rb", args: "configure]) + result = run_rscons(args: %w[-f check_program_failure.rb configure]) expect(result.stderr).to match /Configuration failed/ expect(result.status).to_not eq 0 expect(result.stdout).to match /Checking for program 'program-that-is-not-found'... not found/ @@ -2193,7 +2193,7 @@ EOF it "succeeds when the requested program is not found but :fail is set to false" do test_dir "configure" - result = run_rscons(args: %w[-f check_program_no_fail.rb", args: "configure]) + result = run_rscons(args: %w[-f check_program_no_fail.rb configure]) expect(result.stderr).to eq "" expect(result.status).to eq 0 expect(result.stdout).to match /Checking for program 'program-that-is-not-found'... not found/ @@ -2205,11 +2205,11 @@ EOF it "stores flags and uses them during a build operation" do test_dir "configure" create_exe "pkg-config", "echo '-DMYPACKAGE'" - result = run_rscons(args: %w[-f check_cfg_package.rb", args: "configure]) + result = run_rscons(args: %w[-f check_cfg_package.rb configure]) expect(result.stderr).to eq "" expect(result.status).to eq 0 expect(result.stdout).to match /Checking for package 'mypackage'\.\.\. found/ - result = run_rscons(args: %w[-f check_cfg_package.rb", args: "build]) + result = run_rscons(args: %w[-f check_cfg_package.rb]) expect(result.stderr).to eq "" expect(result.status).to eq 0 expect(result.stdout).to match /gcc.*-o.*\.o.*-DMYPACKAGE/ @@ -2217,7 +2217,7 @@ EOF it "fails when the configure program given does not exist" do test_dir "configure" - result = run_rscons(args: %w[-f check_cfg.rb", args: "configure]) + result = run_rscons(args: %w[-f check_cfg.rb configure]) expect(result.stderr).to match /Configuration failed/ expect(result.status).to_not eq 0 expect(result.stdout).to match /Checking 'my-config'\.\.\. not found/ @@ -2226,11 +2226,11 @@ EOF it "does not use the flags found by default if :use is specified" do test_dir "configure" create_exe "pkg-config", "echo '-DMYPACKAGE'" - result = run_rscons(args: %w[-f check_cfg_use.rb", args: "configure]) + result = run_rscons(args: %w[-f check_cfg_use.rb configure]) expect(result.stderr).to eq "" expect(result.status).to eq 0 expect(result.stdout).to match /Checking for package 'mypackage'\.\.\. found/ - result = run_rscons(args: %w[-f check_cfg_use.rb", args: "build]) + result = run_rscons(args: %w[-f check_cfg_use.rb]) expect(result.stderr).to eq "" expect(result.status).to eq 0 expect(result.stdout).to_not match /gcc.*-o.*myconfigtest1.*-DMYPACKAGE/ @@ -2242,11 +2242,11 @@ EOF it "stores flags and uses them during a build operation" do test_dir "configure" create_exe "my-config", "echo '-DMYCONFIG -lm'" - result = run_rscons(args: %w[-f check_cfg.rb", args: "configure]) + result = run_rscons(args: %w[-f check_cfg.rb configure]) expect(result.stderr).to eq "" expect(result.status).to eq 0 expect(result.stdout).to match /Checking 'my-config'\.\.\. found/ - result = run_rscons(args: %w[-f check_cfg.rb", args: "build]) + result = run_rscons(args: %w[-f check_cfg.rb]) expect(result.stderr).to eq "" expect(result.status).to eq 0 expect(result.stdout).to match /gcc.*-o.*\.o.*-DMYCONFIG/ @@ -2262,7 +2262,7 @@ EOF it "fails configuration with the correct error message" do test_dir "configure" create_exe "grep", "exit 4" - result = run_rscons(args: %w[-f custom_config_check.rb", args: "configure]) + result = run_rscons(args: %w[-f custom_config_check.rb configure]) expect(result.stderr).to match /Configuration failed/ expect(result.stdout).to match /Checking 'grep' version\.\.\. error executing grep/ expect(result.status).to_not eq 0 @@ -2273,7 +2273,7 @@ EOF it "fails configuration with the correct error message" do test_dir "configure" create_exe "grep", "echo 'grep (GNU grep) 1.1'" - result = run_rscons(args: %w[-f custom_config_check.rb", args: "configure]) + result = run_rscons(args: %w[-f custom_config_check.rb configure]) expect(result.stderr).to match /Configuration failed/ expect(result.stdout).to match /Checking 'grep' version\.\.\. too old!/ expect(result.status).to_not eq 0 @@ -2286,11 +2286,11 @@ EOF it "displays the correct message and does not fail configuration" do test_dir "configure" create_exe "grep", "echo 'grep (GNU grep) 2.1'" - result = run_rscons(args: %w[-f custom_config_check.rb", args: "configure]) + result = run_rscons(args: %w[-f custom_config_check.rb configure]) expect(result.stderr).to eq "" expect(result.stdout).to match /Checking 'grep' version\.\.\. we'll work with it but you should upgrade/ expect(result.status).to eq 0 - result = run_rscons(args: %w[-f custom_config_check.rb", args: "build]) + result = run_rscons(args: %w[-f custom_config_check.rb]) expect(result.stderr).to eq "" expect(result.stdout).to match /GREP_WORKAROUND/ expect(result.status).to eq 0 @@ -2302,11 +2302,11 @@ EOF it "passes configuration with the correct message" do test_dir "configure" create_exe "grep", "echo 'grep (GNU grep) 3.0'" - result = run_rscons(args: %w[-f custom_config_check.rb", args: "configure]) + result = run_rscons(args: %w[-f custom_config_check.rb configure]) expect(result.stderr).to eq "" expect(result.stdout).to match /Checking 'grep' version\.\.\. good!/ expect(result.status).to eq 0 - result = run_rscons(args: %w[-f custom_config_check.rb", args: "build]) + result = run_rscons(args: %w[-f custom_config_check.rb]) expect(result.stderr).to eq "" expect(result.stdout).to match /GREP_FULL/ expect(result.status).to eq 0 @@ -2315,7 +2315,7 @@ EOF it "allows passing standard input data to the executed command" do test_dir "configure" - result = run_rscons(args: %w[-f custom_config_check.rb", args: "configure]) + result = run_rscons(args: %w[-f custom_config_check.rb configure]) expect(result.stderr).to eq "" expect(result.stdout).to match /Checking sed -E flag\.\.\. good/ expect(result.status).to eq 0 @@ -2356,10 +2356,10 @@ EOF it "aggregates multiple set_define's" do test_dir "configure" - result = run_rscons(args: %w[-f multiple_set_define.rb", args: "configure]) + result = run_rscons(args: %w[-f multiple_set_define.rb configure]) expect(result.stderr).to eq "" expect(result.status).to eq 0 - result = run_rscons(args: %w[-f multiple_set_define.rb", args: "build]) + result = run_rscons(args: %w[-f multiple_set_define.rb]) expect(result.stderr).to eq "" expect(result.status).to eq 0 expect(result.stdout).to match /gcc.*-o.*\.o.*-DHAVE_MATH_H\s.*-DHAVE_STDIO_H/ @@ -2409,7 +2409,7 @@ EOF expect(result.status).to eq 0 expect(File.exists?("simple.o")).to be_truthy expect(File.exists?("build")).to be_truthy - result = run_rscons(args: %w[-f distclean.rb", args: "distclean]) + result = run_rscons(args: %w[-f distclean.rb distclean]) expect(result.stderr).to eq "" expect(result.status).to eq 0 expect(File.exists?("simple.o")).to be_falsey @@ -2551,7 +2551,7 @@ EOF result = run_rscons(args: %W[-f install.rb configure --prefix=#{prefix}]) expect(result.stderr).to eq "" - result = run_rscons(args: %w[-f install.rb build]) + result = run_rscons(args: %w[-f install.rb]) expect(result.stderr).to eq "" expect(result.stdout).to_not match /Install/ expect(Dir.entries(prefix)).to match_array %w[. ..] @@ -2700,7 +2700,7 @@ EOF result = run_rscons(args: %w[configure]) expect(result.stderr).to eq "" - result = run_rscons(args: %w[build]) + result = run_rscons expect(result.stderr).to eq "" verify_lines(lines(result.stdout), [ %r{sub Rsconscript2 build}, @@ -2734,7 +2734,7 @@ EOF result = run_rscons(args: %w[-f Rsconscript_dir configure]) expect(result.stderr).to eq "" - result = run_rscons(args: %w[-f Rsconscript_dir build]) + result = run_rscons(args: %w[-f Rsconscript_dir]) expect(result.stderr).to eq "" verify_lines(lines(result.stdout), [ %r{sub Rsconscript2 build}, @@ -2774,7 +2774,7 @@ EOF result = run_rscons(args: %w[-f Rsconscript_samedir configure]) expect(result.stderr).to eq "" - result = run_rscons(args: %w[-f Rsconscript_samedir build]) + result = run_rscons(args: %w[-f Rsconscript_samedir]) expect(result.stderr).to eq "" expect(result.stdout).to_not match(%{(Entering|Leaving) directory}) verify_lines(lines(result.stdout), [