From 1eb07e9a22a1bec3049d089b1f43c053c8ab1e59 Mon Sep 17 00:00:00 2001 From: Josh Holtrop Date: Sun, 25 Nov 2018 15:42:09 -0500 Subject: [PATCH] use Rsconscript instead of Rsconsfile - close #62 --- .../build_dir/{Rsconsfile => Rsconscript} | 0 build_tests/cfile/{Rsconsfile => Rsconscript} | 0 .../clone_env/{Rsconsfile => Rsconscript} | 0 .../{Rsconsfile => Rsconscript} | 0 build_tests/d/{Rsconsfile => Rsconscript} | 0 .../header/{Rsconsfile => Rsconscript} | 0 .../json_to_yaml/{Rsconsfile => Rsconscript} | 0 .../library/{Rsconsfile => Rsconscript} | 0 .../preprocess/{Rsconsfile => Rsconscript} | 0 .../{Rsconsfile => Rsconscript} | 0 .../simple/{Rsconsfile => Rsconscript} | 0 .../simple_cc/{Rsconsfile => Rsconscript} | 0 .../two_sources/{Rsconsfile => Rsconscript} | 0 lib/rscons/cli.rb | 22 +- spec/build_tests_spec.rb | 306 +++++++++--------- 15 files changed, 164 insertions(+), 164 deletions(-) rename build_tests/build_dir/{Rsconsfile => Rsconscript} (100%) rename build_tests/cfile/{Rsconsfile => Rsconscript} (100%) rename build_tests/clone_env/{Rsconsfile => Rsconscript} (100%) rename build_tests/custom_builder/{Rsconsfile => Rsconscript} (100%) rename build_tests/d/{Rsconsfile => Rsconscript} (100%) rename build_tests/header/{Rsconsfile => Rsconscript} (100%) rename build_tests/json_to_yaml/{Rsconsfile => Rsconscript} (100%) rename build_tests/library/{Rsconsfile => Rsconscript} (100%) rename build_tests/preprocess/{Rsconsfile => Rsconscript} (100%) rename build_tests/shared_library/{Rsconsfile => Rsconscript} (100%) rename build_tests/simple/{Rsconsfile => Rsconscript} (100%) rename build_tests/simple_cc/{Rsconsfile => Rsconscript} (100%) rename build_tests/two_sources/{Rsconsfile => Rsconscript} (100%) diff --git a/build_tests/build_dir/Rsconsfile b/build_tests/build_dir/Rsconscript similarity index 100% rename from build_tests/build_dir/Rsconsfile rename to build_tests/build_dir/Rsconscript diff --git a/build_tests/cfile/Rsconsfile b/build_tests/cfile/Rsconscript similarity index 100% rename from build_tests/cfile/Rsconsfile rename to build_tests/cfile/Rsconscript diff --git a/build_tests/clone_env/Rsconsfile b/build_tests/clone_env/Rsconscript similarity index 100% rename from build_tests/clone_env/Rsconsfile rename to build_tests/clone_env/Rsconscript diff --git a/build_tests/custom_builder/Rsconsfile b/build_tests/custom_builder/Rsconscript similarity index 100% rename from build_tests/custom_builder/Rsconsfile rename to build_tests/custom_builder/Rsconscript diff --git a/build_tests/d/Rsconsfile b/build_tests/d/Rsconscript similarity index 100% rename from build_tests/d/Rsconsfile rename to build_tests/d/Rsconscript diff --git a/build_tests/header/Rsconsfile b/build_tests/header/Rsconscript similarity index 100% rename from build_tests/header/Rsconsfile rename to build_tests/header/Rsconscript diff --git a/build_tests/json_to_yaml/Rsconsfile b/build_tests/json_to_yaml/Rsconscript similarity index 100% rename from build_tests/json_to_yaml/Rsconsfile rename to build_tests/json_to_yaml/Rsconscript diff --git a/build_tests/library/Rsconsfile b/build_tests/library/Rsconscript similarity index 100% rename from build_tests/library/Rsconsfile rename to build_tests/library/Rsconscript diff --git a/build_tests/preprocess/Rsconsfile b/build_tests/preprocess/Rsconscript similarity index 100% rename from build_tests/preprocess/Rsconsfile rename to build_tests/preprocess/Rsconscript diff --git a/build_tests/shared_library/Rsconsfile b/build_tests/shared_library/Rsconscript similarity index 100% rename from build_tests/shared_library/Rsconsfile rename to build_tests/shared_library/Rsconscript diff --git a/build_tests/simple/Rsconsfile b/build_tests/simple/Rsconscript similarity index 100% rename from build_tests/simple/Rsconsfile rename to build_tests/simple/Rsconscript diff --git a/build_tests/simple_cc/Rsconsfile b/build_tests/simple_cc/Rsconscript similarity index 100% rename from build_tests/simple_cc/Rsconsfile rename to build_tests/simple_cc/Rsconscript diff --git a/build_tests/two_sources/Rsconsfile b/build_tests/two_sources/Rsconscript similarity index 100% rename from build_tests/two_sources/Rsconsfile rename to build_tests/two_sources/Rsconscript diff --git a/lib/rscons/cli.rb b/lib/rscons/cli.rb index 2a45e1e..f9b05a0 100644 --- a/lib/rscons/cli.rb +++ b/lib/rscons/cli.rb @@ -31,7 +31,7 @@ module Rscons module Cli # Default files to look for to execute if none specified. - DEFAULT_RSCONSFILES = %w[Rsconsfile Rsconsfile.rb] + DEFAULT_RSCONSCRIPTS = %w[Rsconscript Rsconscript.rb] class << self @@ -43,14 +43,14 @@ module Rscons # @return [void] def run(argv) argv = argv.dup - rsconsfile = nil + rsconscript = nil do_help = false OptionParser.new do |opts| opts.banner = "Usage: #{$0} [options]" opts.on("-f FILE") do |f| - rsconsfile = f + rsconscript = f end opts.on("-j NTHREADS") do |n_threads| @@ -86,24 +86,24 @@ module Rscons end end - if rsconsfile - unless File.exists?(rsconsfile) - $stderr.puts "Cannot read #{rsconsfile}" + if rsconscript + unless File.exists?(rsconscript) + $stderr.puts "Cannot read #{rsconscript}" exit 1 end else - rsconsfile = DEFAULT_RSCONSFILES.find do |f| + rsconscript = DEFAULT_RSCONSCRIPTS.find do |f| File.exists?(f) end - unless rsconsfile - $stderr.puts "Could not find the Rsconsfile to execute." - $stderr.puts "Looked for: #{DEFAULT_RSCONSFILES.join(", ")}" + unless rsconscript + $stderr.puts "Could not find the Rsconscript to execute." + $stderr.puts "Looked for: #{DEFAULT_RSCONSCRIPTS.join(", ")}" exit 1 end end script = Script.new - script.load(rsconsfile) + script.load(rsconscript) if do_help puts USAGE diff --git a/spec/build_tests_spec.rb b/spec/build_tests_spec.rb index a14923c..818822d 100644 --- a/spec/build_tests_spec.rb +++ b/spec/build_tests_spec.rb @@ -89,14 +89,14 @@ describe Rscons do unless operation.is_a?(Array) operation = [operation] end - rsconsfile_args = - if options[:rsconsfile] - %W[-f #{options[:rsconsfile]}] + rsconscript_args = + if options[:rsconscript] + %W[-f #{options[:rsconscript]}] else [] end rscons_args = options[:rscons_args] || [] - command = %W[ruby -I. -r _simplecov_setup #{@owd}/test/rscons.rb] + rsconsfile_args + rscons_args + operation + command = %W[ruby -I. -r _simplecov_setup #{@owd}/test/rscons.rb] + rsconscript_args + rscons_args + operation @statics[:build_test_id] ||= 0 @statics[:build_test_id] += 1 command_prefix = @@ -166,7 +166,7 @@ EOF it 'prints commands as they are executed' do test_dir('simple') - result = run_rscons(rsconsfile: "command.rb") + result = run_rscons(rsconscript: "command.rb") expect(result.stderr).to eq "" expect(lines(result.stdout)).to eq [ 'gcc -c -o build/simple.o -MMD -MF build/simple.mf simple.c', @@ -235,13 +235,13 @@ EOF it 're-links a program when the link flags have changed' do test_dir('simple') - result = run_rscons(rsconsfile: "command.rb") + result = run_rscons(rsconscript: "command.rb") expect(result.stderr).to eq "" expect(lines(result.stdout)).to eq [ 'gcc -c -o build/simple.o -MMD -MF build/simple.mf simple.c', "gcc -o simple.exe build/simple.o", ] - result = run_rscons(rsconsfile: "link_flag_change.rb") + result = run_rscons(rsconscript: "link_flag_change.rb") expect(result.stderr).to eq "" expect(lines(result.stdout)).to eq [ "gcc -o simple.exe build/simple.o -Llibdir", @@ -259,7 +259,7 @@ EOF it "supports trailing slashes at the end of build_dir sources and destinations" do test_dir("build_dir") - result = run_rscons(rsconsfile: "slashes.rb") + result = run_rscons(rsconscript: "slashes.rb") expect(result.stderr).to eq "" expect(`./build_dir.exe`).to eq "Hello from two()\n" expect(File.exists?("build_one/one.o")).to be_truthy @@ -268,7 +268,7 @@ EOF it 'uses build directories before build root' do test_dir('build_dir') - result = run_rscons(rsconsfile: "build_dirs_and_root.rb") + result = run_rscons(rsconscript: "build_dirs_and_root.rb") expect(result.stderr).to eq "" expect(Set[*lines(result.stdout)]).to eq Set[ "CC build/one/one.o", @@ -279,7 +279,7 @@ EOF it 'uses build_root if no build directories match' do test_dir('build_dir') - result = run_rscons(rsconsfile: "no_match_build_dir.rb") + result = run_rscons(rsconscript: "no_match_build_dir.rb") expect(result.stderr).to eq "" expect(Set[*lines(result.stdout)]).to eq Set[ "CC build_root/src/one/one.o", @@ -290,7 +290,7 @@ EOF it "expands target and source paths starting with ^/ to be relative to the build root" do test_dir('build_dir') - result = run_rscons(rsconsfile: "carat.rb") + result = run_rscons(rsconscript: "carat.rb") expect(result.stderr).to eq "" expect(Set[*lines(result.stdout)]).to eq Set[ %q{gcc -c -o build_root/one.o -MMD -MF build_root/one.mf -Isrc -Isrc/one -Isrc/two build_root/one.c}, @@ -351,7 +351,7 @@ EOF it 'supports custom builders with multiple targets' do test_dir('custom_builder') - result = run_rscons(rsconsfile: "multiple_targets.rb") + result = run_rscons(rsconscript: "multiple_targets.rb") expect(result.stderr).to eq "" slines = lines(result.stdout) expect(slines[0]).to eq("CHGen inc.c") @@ -362,7 +362,7 @@ EOF expect(`./program.exe`).to eq "The value is 42\n" File.open("inc.c", "w") {|fh| fh.puts "int THE_VALUE = 33;"} - result = run_rscons(rsconsfile: "multiple_targets.rb") + result = run_rscons(rsconscript: "multiple_targets.rb") expect(result.stderr).to eq "" expect(lines(result.stdout)).to eq ["CHGen inc.c"] expect(`./program.exe`).to eq "The value is 42\n" @@ -382,7 +382,7 @@ EOF it 'clones all attributes of an Environment object by default' do test_dir('clone_env') - result = run_rscons(rsconsfile: "clone_all.rb") + result = run_rscons(rsconscript: "clone_all.rb") expect(result.stderr).to eq "" expect(lines(result.stdout)).to eq [ %q{gcc -c -o build/program.o -MMD -MF build/program.mf -DSTRING="Hello" -O2 src/program.c}, @@ -433,7 +433,7 @@ EOF it 'supports build hooks to override construction variables' do test_dir("build_dir") - result = run_rscons(rsconsfile: "build_hooks.rb") + result = run_rscons(rsconscript: "build_hooks.rb") expect(result.stderr).to eq "" expect(Set[*lines(result.stdout)]).to eq Set[ 'gcc -c -o build_one/one.o -MMD -MF build_one/one.mf -Isrc/one -Isrc/two -O1 src/one/one.c', @@ -447,23 +447,23 @@ EOF test_dir('simple') File.open("program.ld", "w") {|fh| fh.puts("1")} - result = run_rscons(rsconsfile: "user_dependencies.rb") + result = run_rscons(rsconscript: "user_dependencies.rb") expect(result.stderr).to eq "" expect(lines(result.stdout)).to eq ["CC build/simple.o", "LD simple.exe"] expect(File.exists?('build/simple.o')).to be_truthy expect(`./simple.exe`).to eq "This is a simple C program\n" File.open("program.ld", "w") {|fh| fh.puts("2")} - result = run_rscons(rsconsfile: "user_dependencies.rb") + result = run_rscons(rsconscript: "user_dependencies.rb") expect(result.stderr).to eq "" expect(lines(result.stdout)).to eq(["LD simple.exe"]) File.unlink("program.ld") - result = run_rscons(rsconsfile: "user_dependencies.rb") + result = run_rscons(rsconscript: "user_dependencies.rb") expect(result.stderr).to eq "" expect(lines(result.stdout)).to eq ["LD simple.exe"] - result = run_rscons(rsconsfile: "user_dependencies.rb") + result = run_rscons(rsconscript: "user_dependencies.rb") expect(result.stderr).to eq "" expect(result.stdout).to eq "" end @@ -503,7 +503,7 @@ EOF it "creates shared libraries using D" do test_dir("shared_library") - result = run_rscons(rsconsfile: "shared_library_d.rb") + result = run_rscons(rsconscript: "shared_library_d.rb") # Currently gdc produces an error while trying to build the shared # library. Since this isn't really an rscons problem, I'm commenting out # this check. I'm not sure what I want to do about D support at this @@ -521,19 +521,19 @@ EOF it "supports disassembling object files" do test_dir("simple") - result = run_rscons(rsconsfile: "disassemble.rb") + result = run_rscons(rsconscript: "disassemble.rb") expect(result.stderr).to eq "" expect(File.exists?("simple.txt")).to be_truthy expect(File.read("simple.txt")).to match /Disassembly of section .text:/ - result = run_rscons(rsconsfile: "disassemble.rb") + result = run_rscons(rsconscript: "disassemble.rb") expect(result.stderr).to eq "" expect(result.stdout).to eq "" end it "supports preprocessing C sources" do test_dir("simple") - result = run_rscons(rsconsfile: "preprocess.rb") + result = run_rscons(rsconscript: "preprocess.rb") expect(result.stderr).to eq "" expect(File.read("simplepp.c")).to match /# \d+ "simple.c"/ expect(`./simple.exe`).to eq "This is a simple C program\n" @@ -541,7 +541,7 @@ EOF it "supports preprocessing C++ sources" do test_dir("simple_cc") - result = run_rscons(rsconsfile: "preprocess.rb") + result = run_rscons(rsconscript: "preprocess.rb") expect(result.stderr).to eq "" expect(File.read("simplepp.cc")).to match /# \d+ "simple.cc"/ expect(`./simple.exe`).to eq "This is a simple C++ program\n" @@ -549,13 +549,13 @@ EOF it "supports invoking builders with no sources and a build_root defined" do test_dir("simple") - result = run_rscons(rsconsfile: "build_root_builder_no_sources.rb") + result = run_rscons(rsconscript: "build_root_builder_no_sources.rb") expect(result.stderr).to eq "" end it "expands construction variables in builder target and sources before invoking the builder" do test_dir('custom_builder') - result = run_rscons(rsconsfile: "cvar_expansion.rb") + result = run_rscons(rsconscript: "cvar_expansion.rb") expect(result.stderr).to eq "" expect(lines(result.stdout)).to eq ["CC build/program.o", "LD program.exe"] expect(File.exists?('inc.h')).to be_truthy @@ -564,14 +564,14 @@ EOF it "supports lambdas as construction variable values" do test_dir "custom_builder" - result = run_rscons(rsconsfile: "cvar_lambda.rb") + result = run_rscons(rsconscript: "cvar_lambda.rb") expect(result.stderr).to eq "" expect(`./program.exe`).to eq "The value is 5678\n" end it "supports registering build targets from within a build hook" do test_dir("simple") - result = run_rscons(rsconsfile: "register_target_in_build_hook.rb") + result = run_rscons(rsconscript: "register_target_in_build_hook.rb") expect(result.stderr).to eq "" expect(File.exists?("build/simple.o")).to be_truthy expect(File.exists?("build/simple.o.txt")).to be_truthy @@ -581,7 +581,7 @@ EOF it "supports multiple values for CXXSUFFIX" do test_dir("simple_cc") File.open("other.cccc", "w") {|fh| fh.puts} - result = run_rscons(rsconsfile: "cxxsuffix.rb") + result = run_rscons(rsconscript: "cxxsuffix.rb") expect(result.stderr).to eq "" expect(File.exists?("build/simple.o")).to be_truthy expect(File.exists?("build/other.o")).to be_truthy @@ -591,7 +591,7 @@ EOF it "supports multiple values for CSUFFIX" do test_dir("build_dir") FileUtils.mv("src/one/one.c", "src/one/one.yargh") - result = run_rscons(rsconsfile: "csuffix.rb") + result = run_rscons(rsconscript: "csuffix.rb") expect(result.stderr).to eq "" expect(File.exists?("build/src/one/one.o")).to be_truthy expect(File.exists?("build/src/two/two.o")).to be_truthy @@ -600,7 +600,7 @@ EOF it "supports multiple values for OBJSUFFIX" do test_dir("two_sources") - result = run_rscons(rsconsfile: "objsuffix.rb") + result = run_rscons(rsconscript: "objsuffix.rb") expect(result.stderr).to eq "" expect(File.exists?("two_sources.exe")).to be_truthy expect(File.exists?("one.oooo")).to be_truthy @@ -610,7 +610,7 @@ EOF it "supports multiple values for LIBSUFFIX" do test_dir("two_sources") - result = run_rscons(rsconsfile: "libsuffix.rb") + result = run_rscons(rsconscript: "libsuffix.rb") expect(result.stderr).to eq "" expect(File.exists?("two_sources.exe")).to be_truthy expect(`./two_sources.exe`).to eq "This is a C program with two sources.\n" @@ -618,7 +618,7 @@ EOF it "supports multiple values for ASSUFFIX" do test_dir("two_sources") - result = run_rscons(rsconsfile: "assuffix.rb") + result = run_rscons(rsconscript: "assuffix.rb") expect(result.stderr).to eq "" expect(Set[*lines(result.stdout)]).to eq Set[ "CC one.ssss", @@ -633,7 +633,7 @@ EOF it "supports dumping an Environment's construction variables" do test_dir("simple") - result = run_rscons(rsconsfile: "dump.rb") + result = run_rscons(rsconscript: "dump.rb") expect(result.stderr).to eq "" slines = lines(result.stdout) expect(slines.include?(%{:foo => :bar})).to be_truthy @@ -664,7 +664,7 @@ EOF it "allows construction variable references which expand to arrays in sources of a build target" do test_dir("simple") - result = run_rscons(rsconsfile: "cvar_array.rb") + result = run_rscons(rsconscript: "cvar_array.rb") expect(result.stderr).to eq "" expect(File.exists?("build/simple.o")).to be_truthy expect(`./simple.exe`).to eq "This is a simple C program\n" @@ -672,7 +672,7 @@ EOF it "supports registering multiple build targets with the same target path" do test_dir("build_dir") - result = run_rscons(rsconsfile: "multiple_targets_same_name.rb") + result = run_rscons(rsconscript: "multiple_targets_same_name.rb") expect(result.stderr).to eq "" expect(File.exists?("one.o")).to be_truthy expect(lines(result.stdout)).to eq([ @@ -683,7 +683,7 @@ EOF it "expands target and source paths when builders are registered in build hooks" do test_dir("build_dir") - result = run_rscons(rsconsfile: "post_build_hook_expansion.rb") + result = run_rscons(rsconscript: "post_build_hook_expansion.rb") expect(result.stderr).to eq "" expect(File.exists?("one.o")).to be_truthy expect(File.exists?("two.o")).to be_truthy @@ -698,14 +698,14 @@ EOF File.open("two.c", "w") do |fh| fh.puts("FOO") end - result = run_rscons(rsconsfile: "cache_successful_builds_when_one_fails.rb", + result = run_rscons(rsconscript: "cache_successful_builds_when_one_fails.rb", rscons_args: %w[-j1]) expect(result.stderr).to match /FOO/ expect(File.exists?("simple.o")).to be_truthy expect(File.exists?("two.o")).to be_falsey File.open("two.c", "w") {|fh|} - result = run_rscons(rsconsfile: "cache_successful_builds_when_one_fails.rb", + result = run_rscons(rsconscript: "cache_successful_builds_when_one_fails.rb", rscons_args: %w[-j1]) expect(result.stderr).to eq "" expect(lines(result.stdout)).to eq [ @@ -715,7 +715,7 @@ EOF it "allows overriding PROGSUFFIX" do test_dir("simple") - result = run_rscons(rsconsfile: "progsuffix.rb") + result = run_rscons(rsconscript: "progsuffix.rb") expect(result.stderr).to eq "" expect(lines(result.stdout)).to eq [ "CC build/simple.o", @@ -725,7 +725,7 @@ EOF it "does not use PROGSUFFIX when the Program target name expands to a value already containing an extension" do test_dir("simple") - result = run_rscons(rsconsfile: "progsuffix2.rb") + result = run_rscons(rsconscript: "progsuffix2.rb") expect(result.stderr).to eq "" expect(lines(result.stdout)).to eq [ "CC build/simple.o", @@ -735,7 +735,7 @@ EOF it "allows overriding PROGSUFFIX from extra vars passed in to the builder" do test_dir("simple") - result = run_rscons(rsconsfile: "progsuffix3.rb") + result = run_rscons(rsconscript: "progsuffix3.rb") expect(result.stderr).to eq "" expect(lines(result.stdout)).to eq [ "CC build/simple.o", @@ -745,7 +745,7 @@ EOF it "creates object files under the build root for absolute source paths" do test_dir("simple") - result = run_rscons(rsconsfile: "absolute_source_path.rb") + result = run_rscons(rsconscript: "absolute_source_path.rb") expect(result.stderr).to eq "" slines = lines(result.stdout) expect(slines[0]).to match(%r{^CC build/.*/abs\.o$}) @@ -778,7 +778,7 @@ EOF it "creates shared libraries using C++" do test_dir("shared_library") - result = run_rscons(rsconsfile: "shared_library_cxx.rb") + result = run_rscons(rsconscript: "shared_library_cxx.rb") expect(result.stderr).to eq "" slines = lines(result.stdout) if RUBY_PLATFORM =~ /mingw/ @@ -787,7 +787,7 @@ EOF expect(slines).to include("SHLD libmine.so") end - result = run_rscons(rsconsfile: "shared_library_cxx.rb") + result = run_rscons(rsconscript: "shared_library_cxx.rb") expect(result.stderr).to eq "" expect(result.stdout).to eq "" @@ -798,27 +798,27 @@ EOF it "raises an error for a circular dependency" do test_dir("simple") - result = run_rscons(rsconsfile: "error_circular_dependency.rb") + result = run_rscons(rsconscript: "error_circular_dependency.rb") expect(result.stderr).to match /Possible circular dependency for (foo|bar|baz)/ expect(result.status).to_not eq 0 end it "raises an error for a circular dependency where a build target contains itself in its source list" do test_dir("simple") - result = run_rscons(rsconsfile: "error_circular_dependency2.rb") + result = run_rscons(rsconscript: "error_circular_dependency2.rb") expect(result.stderr).to match /Possible circular dependency for foo/ expect(result.status).to_not eq 0 end it "orders builds to respect user dependencies" do test_dir("simple") - result = run_rscons(rsconsfile: "user_dep_build_order.rb", rscons_args: %w[-j4]) + result = run_rscons(rsconscript: "user_dep_build_order.rb", rscons_args: %w[-j4]) expect(result.stderr).to eq "" end it "waits for all parallelized builds to complete if one fails" do test_dir("simple") - result = run_rscons(rsconsfile: "wait_for_builds_on_failure.rb", rscons_args: %w[-j4]) + result = run_rscons(rsconscript: "wait_for_builds_on_failure.rb", rscons_args: %w[-j4]) expect(result.status).to_not eq 0 expect(result.stderr).to match /Failed to build foo_1/ expect(result.stderr).to match /Failed to build foo_2/ @@ -828,7 +828,7 @@ EOF it "clones n_threads attribute when cloning an Environment" do test_dir("simple") - result = run_rscons(rsconsfile: "clone_n_threads.rb") + result = run_rscons(rsconscript: "clone_n_threads.rb") expect(result.stderr).to eq "" expect(lines(result.stdout)).to eq ["165"] end @@ -836,7 +836,7 @@ EOF it "prints a builder's short description with 'command' echo mode if there is no command" do test_dir("build_dir") - result = run_rscons(rsconsfile: "echo_command_ruby_builder.rb") + result = run_rscons(rsconscript: "echo_command_ruby_builder.rb") expect(result.stderr).to eq "" expect(lines(result.stdout)).to eq ["Install inst.exe"] end @@ -844,7 +844,7 @@ EOF it "supports a string for a builder's echoed 'command' with Environment#print_builder_run_message" do test_dir("build_dir") - result = run_rscons(rsconsfile: "echo_command_string.rb") + result = run_rscons(rsconscript: "echo_command_string.rb") expect(result.stderr).to eq "" expect(lines(result.stdout)).to eq ["MyBuilder foo command"] end @@ -875,7 +875,7 @@ EOF context "backward compatibility" do it "allows a builder to call Environment#run_builder in a non-threaded manner" do test_dir("simple") - result = run_rscons(rsconsfile: "run_builder.rb") + result = run_rscons(rsconscript: "run_builder.rb") expect(result.stderr).to eq "" expect(lines(result.stdout)).to eq [ "CC simple.o", @@ -885,7 +885,7 @@ EOF it "allows a builder to call Environment#build_sources in a non-threaded manner" do test_dir("simple") - result = run_rscons(rsconsfile: "build_sources.rb") + result = run_rscons(rsconscript: "build_sources.rb") expect(result.stderr).to eq "" expect(lines(result.stdout)).to eq [ "CC simple.o", @@ -903,7 +903,7 @@ void one() } EOF end - result = run_rscons(rsconsfile: "build_sources.rb") + result = run_rscons(rsconscript: "build_sources.rb") expect(result.status).to_not eq 0 expect(result.stderr).to match /main/ expect(result.stdout).to match /Failed command was: gcc/ @@ -914,27 +914,27 @@ EOF File.open("simple.c", "wb") do |fh| fh.write("FOOBAR") end - result = run_rscons(rsconsfile: "run_builder.rb") + result = run_rscons(rsconscript: "run_builder.rb") expect(result.stderr).to match /Failed to build/ expect(result.stdout).to match /Failed command was: gcc/ end it "supports builders that call Builder#standard_build" do test_dir("simple") - result = run_rscons(rsconsfile: "standard_build.rb") + result = run_rscons(rsconscript: "standard_build.rb") expect(result.stderr).to eq "" expect(lines(result.stdout)).to eq ["MyCommand simple.o"] end it "supports the old 3-parameter signature to Builder#produces?" do test_dir("simple") - result = run_rscons(rsconsfile: "bc_produces.rb") + result = run_rscons(rsconscript: "bc_produces.rb") expect(result.stderr).to eq "" end it 'supports build hooks to override construction variables' do test_dir("build_dir") - result = run_rscons(rsconsfile: "backward_compatible_build_hooks.rb") + result = run_rscons(rsconscript: "backward_compatible_build_hooks.rb") expect(result.stderr).to eq "" expect(Set[*lines(result.stdout)]).to eq Set[ 'gcc -c -o one.o -MMD -MF one.mf -Isrc -Isrc/one -Isrc/two -O1 src/two/two.c', @@ -963,7 +963,7 @@ EOF it "raises an error when an unknown source file is specified" do test_dir("cfile") - result = run_rscons(rsconsfile: "error_unknown_extension.rb") + result = run_rscons(rsconscript: "error_unknown_extension.rb") expect(result.stderr).to match /Unknown source file .foo.bar. for CFile builder/ expect(result.status).to_not eq 0 end @@ -973,12 +973,12 @@ EOF it "allows executing an arbitrary command" do test_dir('simple') - result = run_rscons(rsconsfile: "command_builder.rb") + result = run_rscons(rsconscript: "command_builder.rb") expect(result.stderr).to eq "" expect(lines(result.stdout)).to eq ["BuildIt simple.exe"] expect(`./simple.exe`).to eq "This is a simple C program\n" - result = run_rscons(rsconsfile: "command_builder.rb") + result = run_rscons(rsconscript: "command_builder.rb") expect(result.stderr).to eq "" expect(result.stdout).to eq "" end @@ -986,7 +986,7 @@ EOF it "allows redirecting standard output to a file" do test_dir("simple") - result = run_rscons(rsconsfile: "command_redirect.rb") + result = run_rscons(rsconscript: "command_redirect.rb") expect(result.stderr).to eq "" expect(lines(result.stdout)).to eq [ "CC simple.o", @@ -999,7 +999,7 @@ EOF context "Directory builder" do it "creates the requested directory" do test_dir("simple") - result = run_rscons(rsconsfile: "directory.rb") + result = run_rscons(rsconscript: "directory.rb") expect(result.stderr).to eq "" expect(lines(result.stdout)).to eq(["Directory teh_dir"]) expect(File.directory?("teh_dir")).to be_truthy @@ -1008,7 +1008,7 @@ EOF it "succeeds when the requested directory already exists" do test_dir("simple") FileUtils.mkdir("teh_dir") - result = run_rscons(rsconsfile: "directory.rb") + result = run_rscons(rsconscript: "directory.rb") expect(result.stderr).to eq "" expect(result.stdout).to eq "" expect(File.directory?("teh_dir")).to be_truthy @@ -1017,7 +1017,7 @@ EOF it "fails when the target path is a file" do test_dir("simple") FileUtils.touch("teh_dir") - result = run_rscons(rsconsfile: "directory.rb") + result = run_rscons(rsconscript: "directory.rb") expect(result.stderr).to match %r{Error: `teh_dir' already exists and is not a directory} end end @@ -1026,11 +1026,11 @@ EOF it "copies a file to the target file name" do test_dir("build_dir") - result = run_rscons(rsconsfile: "install.rb") + result = run_rscons(rsconscript: "install.rb") expect(result.stderr).to eq "" expect(lines(result.stdout)).to eq ["Install inst.exe"] - result = run_rscons(rsconsfile: "install.rb") + result = run_rscons(rsconscript: "install.rb") expect(result.stderr).to eq "" expect(result.stdout).to eq "" @@ -1038,7 +1038,7 @@ EOF expect(File.read("inst.exe", mode: "rb")).to eq(File.read("install.rb", mode: "rb")) FileUtils.rm("inst.exe") - result = run_rscons(rsconsfile: "install.rb") + result = run_rscons(rsconscript: "install.rb") expect(result.stderr).to eq "" expect(lines(result.stdout)).to eq ["Install inst.exe"] end @@ -1046,11 +1046,11 @@ EOF it "operates the same as a Copy builder" do test_dir("build_dir") - result = run_rscons(rsconsfile: "copy.rb") + result = run_rscons(rsconscript: "copy.rb") expect(result.stderr).to eq "" expect(lines(result.stdout)).to eq ["Copy inst.exe"] - result = run_rscons(rsconsfile: "copy.rb") + result = run_rscons(rsconscript: "copy.rb") expect(result.stderr).to eq "" expect(result.stdout).to eq "" @@ -1058,7 +1058,7 @@ EOF expect(File.read("inst.exe", mode: "rb")).to eq(File.read("copy.rb", mode: "rb")) FileUtils.rm("inst.exe") - result = run_rscons(rsconsfile: "copy.rb") + result = run_rscons(rsconscript: "copy.rb") expect(result.stderr).to eq "" expect(lines(result.stdout)).to eq ["Copy inst.exe"] end @@ -1066,20 +1066,20 @@ EOF it "copies a file to the target directory name" do test_dir "build_dir" - result = run_rscons(rsconsfile: "install_directory.rb") + result = run_rscons(rsconscript: "install_directory.rb") expect(result.stderr).to eq "" expect(lines(result.stdout)).to include("Install inst") expect(File.exists?("inst/install_directory.rb")).to be_truthy expect(File.read("inst/install_directory.rb", mode: "rb")).to eq(File.read("install_directory.rb", mode: "rb")) - result = run_rscons(rsconsfile: "install_directory.rb") + result = run_rscons(rsconscript: "install_directory.rb") expect(result.stderr).to eq "" expect(result.stdout).to eq "" end it "copies a directory to the non-existent target directory name" do test_dir "build_dir" - result = run_rscons(rsconsfile: "install_directory.rb") + result = run_rscons(rsconscript: "install_directory.rb") expect(result.stderr).to eq "" expect(lines(result.stdout)).to include("Install noexist/src") %w[src/one/one.c src/two/two.c src/two/two.h].each do |f| @@ -1090,7 +1090,7 @@ EOF it "copies a directory to the existent target directory name" do test_dir "build_dir" - result = run_rscons(rsconsfile: "install_directory.rb") + result = run_rscons(rsconscript: "install_directory.rb") expect(result.stderr).to eq "" expect(lines(result.stdout)).to include("Install exist/src") %w[src/one/one.c src/two/two.c src/two/two.h].each do |f| @@ -1104,7 +1104,7 @@ EOF it "allows specifying a Symbol as a target name and reruns the builder if the sources or command have changed" do test_dir("simple") - result = run_rscons(rsconsfile: "phony_target.rb") + result = run_rscons(rsconscript: "phony_target.rb") expect(result.stderr).to eq "" expect(lines(result.stdout)).to eq([ "CC build/simple.o", @@ -1112,7 +1112,7 @@ EOF "Checker simple.exe", ]) - result = run_rscons(rsconsfile: "phony_target.rb") + result = run_rscons(rsconscript: "phony_target.rb") expect(result.stderr).to eq "" expect(result.stdout).to eq "" @@ -1121,7 +1121,7 @@ EOF File.open("simple.exe", "w") do |fh| fh.puts "Changed simple.exe" end - result = run_rscons(rsconsfile: "phony_target2.rb") + result = run_rscons(rsconscript: "phony_target2.rb") expect(result.stderr).to eq "" expect(lines(result.stdout)).to eq([ "Checker simple.exe", @@ -1132,7 +1132,7 @@ EOF context "Environment#clear_targets" do it "clears registered targets" do test_dir("simple") - result = run_rscons(rsconsfile: "clear_targets.rb") + result = run_rscons(rsconscript: "clear_targets.rb") expect(result.stderr).to eq "" expect(result.stdout).to eq "" end @@ -1201,7 +1201,7 @@ EOF "LD simple.exe", ] - result = run_rscons(rsconsfile: "cache_command_change.rb") + result = run_rscons(rsconscript: "cache_command_change.rb") expect(result.stderr).to eq "" expect(lines(result.stdout)).to eq [ "LD simple.exe", @@ -1211,14 +1211,14 @@ EOF it "forces a build when there is a new dependency" do test_dir("simple") - result = run_rscons(rsconsfile: "cache_new_dep1.rb") + result = run_rscons(rsconscript: "cache_new_dep1.rb") expect(result.stderr).to eq "" expect(lines(result.stdout)).to eq [ "CC simple.o", "LD simple.exe", ] - result = run_rscons(rsconsfile: "cache_new_dep2.rb") + result = run_rscons(rsconscript: "cache_new_dep2.rb") expect(result.stderr).to eq "" expect(lines(result.stdout)).to eq [ "LD simple.exe", @@ -1228,14 +1228,14 @@ EOF it "forces a build when a dependency's checksum has changed" do test_dir("simple") - result = run_rscons(rsconsfile: "cache_dep_checksum_change.rb") + result = run_rscons(rsconscript: "cache_dep_checksum_change.rb") expect(result.stderr).to eq "" expect(lines(result.stdout)).to eq ["Copy simple.copy"] File.open("simple.c", "wb") do |fh| fh.write("hi") end - result = run_rscons(rsconsfile: "cache_dep_checksum_change.rb") + result = run_rscons(rsconscript: "cache_dep_checksum_change.rb") expect(result.stderr).to eq "" expect(lines(result.stdout)).to eq ["Copy simple.copy"] end @@ -1246,18 +1246,18 @@ EOF File.open("sources", "wb") do |fh| fh.write("one.o two.o") end - result = run_rscons(rsconsfile: "cache_strict_deps.rb") + result = run_rscons(rsconscript: "cache_strict_deps.rb") expect(result.stderr).to eq "" expect(lines(result.stdout)).to include "gcc -o program.exe one.o two.o" - result = run_rscons(rsconsfile: "cache_strict_deps.rb") + result = run_rscons(rsconscript: "cache_strict_deps.rb") expect(result.stderr).to eq "" expect(result.stdout).to eq "" File.open("sources", "wb") do |fh| fh.write("two.o one.o") end - result = run_rscons(rsconsfile: "cache_strict_deps.rb") + result = run_rscons(rsconscript: "cache_strict_deps.rb") expect(result.stderr).to eq "" expect(lines(result.stdout)).to include "gcc -o program.exe one.o two.o" end @@ -1267,7 +1267,7 @@ EOF File.open("foo", "wb") {|fh| fh.write("hi")} File.open("user_deps", "wb") {|fh| fh.write("")} - result = run_rscons(rsconsfile: "cache_user_dep.rb") + result = run_rscons(rsconscript: "cache_user_dep.rb") expect(result.stderr).to eq "" expect(lines(result.stdout)).to eq [ "CC build/simple.o", @@ -1275,7 +1275,7 @@ EOF ] File.open("user_deps", "wb") {|fh| fh.write("foo")} - result = run_rscons(rsconsfile: "cache_user_dep.rb") + result = run_rscons(rsconscript: "cache_user_dep.rb") expect(result.stderr).to eq "" expect(lines(result.stdout)).to eq [ "LD simple.exe", @@ -1287,19 +1287,19 @@ EOF File.open("foo", "wb") {|fh| fh.write("hi")} File.open("user_deps", "wb") {|fh| fh.write("foo")} - result = run_rscons(rsconsfile: "cache_user_dep.rb") + result = run_rscons(rsconscript: "cache_user_dep.rb") expect(result.stderr).to eq "" expect(lines(result.stdout)).to eq [ "CC build/simple.o", "LD simple.exe", ] - result = run_rscons(rsconsfile: "cache_user_dep.rb") + result = run_rscons(rsconscript: "cache_user_dep.rb") expect(result.stderr).to eq "" expect(result.stdout).to eq "" File.open("foo", "wb") {|fh| fh.write("hi2")} - result = run_rscons(rsconsfile: "cache_user_dep.rb") + result = run_rscons(rsconscript: "cache_user_dep.rb") expect(result.stderr).to eq "" expect(lines(result.stdout)).to eq [ "LD simple.exe", @@ -1308,12 +1308,12 @@ EOF it "allows a VarSet to be passed in as the command parameter" do test_dir("simple") - result = run_rscons(rsconsfile: "cache_varset.rb") + result = run_rscons(rsconscript: "cache_varset.rb") expect(result.stderr).to eq "" expect(lines(result.stdout)).to eq [ "TestBuilder foo", ] - result = run_rscons(rsconsfile: "cache_varset.rb") + result = run_rscons(rsconscript: "cache_varset.rb") expect(result.stderr).to eq "" expect(result.stdout).to eq "" end @@ -1321,7 +1321,7 @@ EOF context "debugging" do it "prints a message when the target does not exist" do test_dir("simple") - result = run_rscons(rsconsfile: "cache_debugging.rb") + result = run_rscons(rsconscript: "cache_debugging.rb") expect(result.stderr).to eq "" expect(result.stdout).to match /Target foo\.o needs rebuilding because it does not exist on disk/ end @@ -1329,67 +1329,67 @@ EOF it "prints a message when there is no cached build information for the target" do test_dir("simple") FileUtils.touch("foo.o") - result = run_rscons(rsconsfile: "cache_debugging.rb") + result = run_rscons(rsconscript: "cache_debugging.rb") expect(result.stderr).to eq "" expect(result.stdout).to match /Target foo\.o needs rebuilding because there is no cached build information for it/ end it "prints a message when the target file has changed on disk" do test_dir("simple") - result = run_rscons(rsconsfile: "cache_debugging.rb") + result = run_rscons(rsconscript: "cache_debugging.rb") expect(result.stderr).to eq "" File.open("foo.o", "wb") {|fh| fh.puts "hi"} - result = run_rscons(rsconsfile: "cache_debugging.rb") + result = run_rscons(rsconscript: "cache_debugging.rb") expect(result.stderr).to eq "" expect(result.stdout).to match /Target foo\.o needs rebuilding because it has been changed on disk since being built last/ end it "prints a message when the command has changed" do test_dir("simple") - result = run_rscons(rsconsfile: "cache_debugging.rb") + result = run_rscons(rsconscript: "cache_debugging.rb") expect(result.stderr).to eq "" - result = run_rscons(rsconsfile: "cache_debugging.rb", op: %w[build command_change=yes]) + result = run_rscons(rsconscript: "cache_debugging.rb", op: %w[build command_change=yes]) expect(result.stderr).to eq "" expect(result.stdout).to match /Target foo\.o needs rebuilding because the command used to build it has changed/ end it "prints a message when strict_deps is in use and the set of dependencies does not match" do test_dir("simple") - result = run_rscons(rsconsfile: "cache_debugging.rb", op: %w[build strict_deps1=yes]) + result = run_rscons(rsconscript: "cache_debugging.rb", op: %w[build strict_deps1=yes]) expect(result.stderr).to eq "" - result = run_rscons(rsconsfile: "cache_debugging.rb", op: %w[build strict_deps2=yes]) + result = run_rscons(rsconscript: "cache_debugging.rb", op: %w[build strict_deps2=yes]) expect(result.stderr).to eq "" expect(result.stdout).to match /Target foo\.o needs rebuilding because the :strict_deps option is given and the set of dependencies does not match the previous set of dependencies/ end it "prints a message when there is a new dependency" do test_dir("simple") - result = run_rscons(rsconsfile: "cache_debugging.rb") + result = run_rscons(rsconscript: "cache_debugging.rb") expect(result.stderr).to eq "" - result = run_rscons(rsconsfile: "cache_debugging.rb", op: %w[build new_dep=yes]) + result = run_rscons(rsconscript: "cache_debugging.rb", op: %w[build new_dep=yes]) expect(result.stderr).to eq "" expect(result.stdout).to match /Target foo\.o needs rebuilding because there are new dependencies/ end it "prints a message when there is a new user-specified dependency" do test_dir("simple") - result = run_rscons(rsconsfile: "cache_debugging.rb") + result = run_rscons(rsconscript: "cache_debugging.rb") expect(result.stderr).to eq "" - result = run_rscons(rsconsfile: "cache_debugging.rb", op: %w[build new_user_dep=yes]) + result = run_rscons(rsconscript: "cache_debugging.rb", op: %w[build new_user_dep=yes]) expect(result.stderr).to eq "" expect(result.stdout).to match /Target foo\.o needs rebuilding because the set of user-specified dependency files has changed/ end it "prints a message when a dependency file has changed" do test_dir("simple") - result = run_rscons(rsconsfile: "cache_debugging.rb") + result = run_rscons(rsconscript: "cache_debugging.rb") expect(result.stderr).to eq "" f = File.read("simple.c", mode: "rb") f += "\n" File.open("simple.c", "wb") do |fh| fh.write(f) end - result = run_rscons(rsconsfile: "cache_debugging.rb") + result = run_rscons(rsconscript: "cache_debugging.rb") expect(result.stderr).to eq "" expect(result.stdout).to match /Target foo\.o needs rebuilding because dependency file simple\.c has changed/ end @@ -1399,7 +1399,7 @@ EOF context "Object builder" do it "allows overriding CCCMD construction variable" do test_dir("simple") - result = run_rscons(rsconsfile: "override_cccmd.rb") + result = run_rscons(rsconscript: "override_cccmd.rb") expect(result.stderr).to eq "" expect(lines(result.stdout)).to eq [ "gcc -c -o simple.o -Dfoobar simple.c", @@ -1408,7 +1408,7 @@ EOF it "allows overriding DEPFILESUFFIX construction variable" do test_dir("simple") - result = run_rscons(rsconsfile: "override_depfilesuffix.rb") + result = run_rscons(rsconscript: "override_depfilesuffix.rb") expect(result.stderr).to eq "" expect(lines(result.stdout)).to eq [ "gcc -c -o simple.o -MMD -MF simple.deppy simple.c", @@ -1417,7 +1417,7 @@ EOF it "raises an error when given a source file with an unknown suffix" do test_dir("simple") - result = run_rscons(rsconsfile: "error_unknown_suffix.rb") + result = run_rscons(rsconscript: "error_unknown_suffix.rb") expect(result.stderr).to match /unknown input file type: "foo.xyz"/ end end @@ -1425,7 +1425,7 @@ EOF context "SharedObject builder" do it "raises an error when given a source file with an unknown suffix" do test_dir("shared_library") - result = run_rscons(rsconsfile: "error_unknown_suffix.rb") + result = run_rscons(rsconscript: "error_unknown_suffix.rb") expect(result.stderr).to match /unknown input file type: "foo.xyz"/ end end @@ -1433,7 +1433,7 @@ EOF context "Library builder" do it "allows overriding ARCMD construction variable" do test_dir("library") - result = run_rscons(rsconsfile: "override_arcmd.rb") + result = run_rscons(rsconscript: "override_arcmd.rb") expect(result.stderr).to eq "" expect(lines(result.stdout)).to include "ar rcf lib.a build/one.o build/three.o build/two.o" end @@ -1443,7 +1443,7 @@ EOF it "allows explicitly specifying SHLD construction variable value" do test_dir("shared_library") - result = run_rscons(rsconsfile: "shared_library_set_shld.rb") + result = run_rscons(rsconscript: "shared_library_set_shld.rb") expect(result.stderr).to eq "" slines = lines(result.stdout) if RUBY_PLATFORM =~ /mingw/ @@ -1458,7 +1458,7 @@ EOF it "waits for subcommands in threads for builders that support threaded commands" do test_dir("simple") start_time = Time.new - result = run_rscons(rsconsfile: "threading.rb", rscons_args: %w[-j 4]) + result = run_rscons(rsconscript: "threading.rb", rscons_args: %w[-j 4]) expect(result.stderr).to eq "" expect(Set[*lines(result.stdout)]).to eq Set[ "ThreadedTestBuilder a", @@ -1472,13 +1472,13 @@ EOF it "allows the user to specify that a target be built after another" do test_dir("custom_builder") - result = run_rscons(rsconsfile: "build_after.rb", rscons_args: %w[-j 4]) + result = run_rscons(rsconscript: "build_after.rb", rscons_args: %w[-j 4]) expect(result.stderr).to eq "" end it "allows the user to specify side-effect files produced by another builder" do test_dir("custom_builder") - result = run_rscons(rsconsfile: "produces.rb", rscons_args: %w[-j 4]) + result = run_rscons(rsconscript: "produces.rb", rscons_args: %w[-j 4]) expect(result.stderr).to eq "" expect(File.exists?("copy_inc.h")).to be_truthy end @@ -1501,17 +1501,17 @@ EOF expect(result.stdout).to match /Usage:/ end - it "prints an error and exits with an error status when a default Rsconsfile cannot be found" do + it "prints an error and exits with an error status when a default Rsconscript cannot be found" do test_dir("simple") - FileUtils.rm_f("Rsconsfile") + FileUtils.rm_f("Rsconscript") result = run_rscons - expect(result.stderr).to match /Could not find the Rsconsfile to execute/ + expect(result.stderr).to match /Could not find the Rsconscript to execute/ expect(result.status).to_not eq 0 end - it "prints an error and exits with an error status when the given Rsconsfile cannot be read" do + it "prints an error and exits with an error status when the given Rsconscript cannot be read" do test_dir("simple") - result = run_rscons(rsconsfile: "nonexistent") + result = run_rscons(rsconscript: "nonexistent") expect(result.stderr).to match /Cannot read nonexistent/ expect(result.status).to_not eq 0 end @@ -1520,18 +1520,18 @@ EOF context "configure" do it "raises a method not found error for configure methods called outside a configure block" do test_dir "configure" - result = run_rscons(rsconsfile: "scope.rb") + result = run_rscons(rsconscript: "scope.rb") expect(result.stderr).to match /NoMethodError/ expect(result.status).to_not eq 0 end context "check_c_compiler" do {"check_c_compiler.rb" => "when no arguments are given", - "check_c_compiler_find_first.rb" => "when arguments are given"}.each_pair do |rsconsfile, desc| + "check_c_compiler_find_first.rb" => "when arguments are given"}.each_pair do |rsconscript, desc| context desc do it "finds the first listed C compiler" do test_dir "configure" - result = run_rscons(rsconsfile: rsconsfile, op: "configure") + result = run_rscons(rsconscript: rsconscript, op: "configure") expect(result.stderr).to eq "" expect(result.status).to eq 0 expect(result.stdout).to match /Checking for C compiler\.\.\. gcc/ @@ -1540,7 +1540,7 @@ EOF it "finds the second listed C compiler" do test_dir "configure" create_exe "gcc", "exit 1" - result = run_rscons(rsconsfile: rsconsfile, op: "configure") + result = run_rscons(rsconscript: rsconscript, op: "configure") expect(result.stderr).to eq "" expect(result.status).to eq 0 expect(result.stdout).to match /Checking for C compiler\.\.\. clang/ @@ -1550,7 +1550,7 @@ EOF test_dir "configure" create_exe "gcc", "exit 1" create_exe "clang", "exit 1" - result = run_rscons(rsconsfile: rsconsfile, op: "configure") + result = run_rscons(rsconscript: rsconscript, op: "configure") expect(result.stderr).to eq "" expect(result.status).to_not eq 0 expect(result.stdout).to match /Checking for C compiler\.\.\. not found/ @@ -1561,11 +1561,11 @@ EOF context "check_cxx_compiler" do {"check_cxx_compiler.rb" => "when no arguments are given", - "check_cxx_compiler_find_first.rb" => "when arguments are given"}.each_pair do |rsconsfile, desc| + "check_cxx_compiler_find_first.rb" => "when arguments are given"}.each_pair do |rsconscript, desc| context desc do it "finds the first listed C++ compiler" do test_dir "configure" - result = run_rscons(rsconsfile: rsconsfile, op: "configure") + result = run_rscons(rsconscript: rsconscript, op: "configure") expect(result.stderr).to eq "" expect(result.status).to eq 0 expect(result.stdout).to match /Checking for C\+\+ compiler\.\.\. g\+\+/ @@ -1574,7 +1574,7 @@ EOF it "finds the second listed C++ compiler" do test_dir "configure" create_exe "g++", "exit 1" - result = run_rscons(rsconsfile: rsconsfile, op: "configure") + result = run_rscons(rsconscript: rsconscript, op: "configure") expect(result.stderr).to eq "" expect(result.status).to eq 0 expect(result.stdout).to match /Checking for C\+\+ compiler\.\.\. clang\+\+/ @@ -1584,7 +1584,7 @@ EOF test_dir "configure" create_exe "g++", "exit 1" create_exe "clang++", "exit 1" - result = run_rscons(rsconsfile: rsconsfile, op: "configure") + result = run_rscons(rsconscript: rsconscript, op: "configure") expect(result.stderr).to eq "" expect(result.status).to_not eq 0 expect(result.stdout).to match /Checking for C\+\+ compiler\.\.\. not found/ @@ -1595,11 +1595,11 @@ EOF 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| + "check_d_compiler_find_first.rb" => "when arguments are given"}.each_pair do |rsconscript, desc| context desc do it "finds the first listed D compiler" do test_dir "configure" - result = run_rscons(rsconsfile: rsconsfile, op: "configure") + result = run_rscons(rsconscript: rsconscript, op: "configure") expect(result.stderr).to eq "" expect(result.status).to eq 0 expect(result.stdout).to match /Checking for D compiler\.\.\. gdc/ @@ -1608,7 +1608,7 @@ EOF it "finds the second listed D compiler" do test_dir "configure" create_exe "gdc", "exit 1" - result = run_rscons(rsconsfile: rsconsfile, op: "configure") + result = run_rscons(rsconscript: rsconscript, op: "configure") expect(result.stderr).to eq "" expect(result.status).to eq 0 expect(result.stdout).to match /Checking for D compiler\.\.\. ldc2/ @@ -1618,7 +1618,7 @@ EOF test_dir "configure" create_exe "gdc", "exit 1" create_exe "ldc2", "exit 1" - result = run_rscons(rsconsfile: rsconsfile, op: "configure") + result = run_rscons(rsconscript: rsconscript, 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/ @@ -1630,7 +1630,7 @@ EOF context "check_c_header" do it "succeeds when the requested header is found" do test_dir "configure" - result = run_rscons(rsconsfile: "check_c_header_success.rb", op: "configure") + result = run_rscons(rsconscript: "check_c_header_success.rb", op: "configure") expect(result.stderr).to eq "" expect(result.status).to eq 0 expect(result.stdout).to match /Checking for C header 'string\.h'... found/ @@ -1638,7 +1638,7 @@ EOF it "fails when the requested header is not found" do test_dir "configure" - result = run_rscons(rsconsfile: "check_c_header_failure.rb", op: "configure") + result = run_rscons(rsconscript: "check_c_header_failure.rb", op: "configure") expect(result.stderr).to eq "" expect(result.status).to_not eq 0 expect(result.stdout).to match /Checking for C header 'not___found\.h'... not found/ @@ -1646,7 +1646,7 @@ EOF it "succeeds when the requested header is not found but :fail is set to false" do test_dir "configure" - result = run_rscons(rsconsfile: "check_c_header_no_fail.rb", op: "configure") + result = run_rscons(rsconscript: "check_c_header_no_fail.rb", op: "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/ @@ -1656,7 +1656,7 @@ EOF context "check_cxx_header" do it "succeeds when the requested header is found" do test_dir "configure" - result = run_rscons(rsconsfile: "check_cxx_header_success.rb", op: "configure") + result = run_rscons(rsconscript: "check_cxx_header_success.rb", op: "configure") expect(result.stderr).to eq "" expect(result.status).to eq 0 expect(result.stdout).to match /Checking for C\+\+ header 'string\.h'... found/ @@ -1664,7 +1664,7 @@ EOF it "fails when the requested header is not found" do test_dir "configure" - result = run_rscons(rsconsfile: "check_cxx_header_failure.rb", op: "configure") + result = run_rscons(rsconscript: "check_cxx_header_failure.rb", op: "configure") expect(result.stderr).to eq "" expect(result.status).to_not eq 0 expect(result.stdout).to match /Checking for C\+\+ header 'not___found\.h'... not found/ @@ -1672,7 +1672,7 @@ EOF it "succeeds when the requested header is not found but :fail is set to false" do test_dir "configure" - result = run_rscons(rsconsfile: "check_cxx_header_no_fail.rb", op: "configure") + result = run_rscons(rsconscript: "check_cxx_header_no_fail.rb", op: "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/ @@ -1682,7 +1682,7 @@ EOF context "check_d_import" do it "succeeds when the requested import is found" do test_dir "configure" - result = run_rscons(rsconsfile: "check_d_import_success.rb", op: "configure") + result = run_rscons(rsconscript: "check_d_import_success.rb", op: "configure") expect(result.stderr).to eq "" expect(result.status).to eq 0 expect(result.stdout).to match /Checking for D import 'std\.stdio'... found/ @@ -1690,7 +1690,7 @@ EOF it "fails when the requested import is not found" do test_dir "configure" - result = run_rscons(rsconsfile: "check_d_import_failure.rb", op: "configure") + result = run_rscons(rsconscript: "check_d_import_failure.rb", op: "configure") expect(result.stderr).to eq "" expect(result.status).to_not eq 0 expect(result.stdout).to match /Checking for D import 'not\.found'... not found/ @@ -1698,7 +1698,7 @@ EOF it "succeeds when the requested import is not found but :fail is set to false" do test_dir "configure" - result = run_rscons(rsconsfile: "check_d_import_no_fail.rb", op: "configure") + result = run_rscons(rsconscript: "check_d_import_no_fail.rb", op: "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/ @@ -1708,7 +1708,7 @@ EOF context "check_lib" do it "succeeds when the requested library is found" do test_dir "configure" - result = run_rscons(rsconsfile: "check_lib_success.rb", op: "configure") + result = run_rscons(rsconscript: "check_lib_success.rb", op: "configure") expect(result.stderr).to eq "" expect(result.status).to eq 0 expect(result.stdout).to match /Checking for library 'm'... found/ @@ -1716,7 +1716,7 @@ EOF it "fails when the requested library is not found" do test_dir "configure" - result = run_rscons(rsconsfile: "check_lib_failure.rb", op: "configure") + result = run_rscons(rsconscript: "check_lib_failure.rb", op: "configure") expect(result.stderr).to eq "" expect(result.status).to_not eq 0 expect(result.stdout).to match /Checking for library 'mfoofoo'... not found/ @@ -1724,7 +1724,7 @@ EOF it "succeeds when the requested library is not found but :fail is set to false" do test_dir "configure" - result = run_rscons(rsconsfile: "check_lib_no_fail.rb", op: "configure") + result = run_rscons(rsconscript: "check_lib_no_fail.rb", op: "configure") expect(result.stderr).to eq "" expect(result.status).to eq 0 expect(result.stdout).to match /Checking for library 'mfoofoo'... not found/ @@ -1734,7 +1734,7 @@ EOF context "check_program" do it "succeeds when the requested program is found" do test_dir "configure" - result = run_rscons(rsconsfile: "check_program_success.rb", op: "configure") + result = run_rscons(rsconscript: "check_program_success.rb", op: "configure") expect(result.stderr).to eq "" expect(result.status).to eq 0 expect(result.stdout).to match /Checking for program 'find'... .*find/ @@ -1742,7 +1742,7 @@ EOF it "fails when the requested program is not found" do test_dir "configure" - result = run_rscons(rsconsfile: "check_program_failure.rb", op: "configure") + result = run_rscons(rsconscript: "check_program_failure.rb", op: "configure") expect(result.stderr).to eq "" expect(result.status).to_not eq 0 expect(result.stdout).to match /Checking for program 'program-that-is-not-found'... not found/ @@ -1750,7 +1750,7 @@ EOF it "succeeds when the requested program is not found but :fail is set to false" do test_dir "configure" - result = run_rscons(rsconsfile: "check_program_no_fail.rb", op: "configure") + result = run_rscons(rsconscript: "check_program_no_fail.rb", op: "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/ @@ -1761,11 +1761,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(rsconsfile: "check_cfg.rb", op: "configure") + result = run_rscons(rsconscript: "check_cfg.rb", op: "configure") expect(result.stderr).to eq "" expect(result.status).to eq 0 expect(result.stdout).to match /Checking 'my-config'\.\.\. found/ - result = run_rscons(rsconsfile: "check_cfg.rb", op: "build") + result = run_rscons(rsconscript: "check_cfg.rb", op: "build") expect(result.stderr).to eq "" expect(result.status).to eq 0 expect(result.stdout).to match /gcc.*-o.*\.o.*-DMYCONFIG/