diff --git a/build_tests/simple/cache_debugging.rb b/build_tests/simple/cache_debugging.rb index 4a7c8ba..77a381d 100644 --- a/build_tests/simple/cache_debugging.rb +++ b/build_tests/simple/cache_debugging.rb @@ -4,7 +4,7 @@ class DebugBuilder < Rscons::Builder finalize_command else @command = %W[gcc -c -o #{@target} #{@sources.first}] - if ENV["command_change"] == "command_change" + if ENV["test"] == "command_change" @command += %w[-Wall] end if ENV["test"] == "new_dep" diff --git a/lib/rscons/cli.rb b/lib/rscons/cli.rb index 29f9b60..21b4de1 100644 --- a/lib/rscons/cli.rb +++ b/lib/rscons/cli.rb @@ -41,6 +41,7 @@ module Rscons end unless valid_arg $stderr.puts "Invalid task '#{task}' argument '#{argv[0].split("=").first}'" + $stderr.puts usage exit 2 end else diff --git a/spec/build_tests_spec.rb b/spec/build_tests_spec.rb index 89fea88..89eab92 100644 --- a/spec/build_tests_spec.rb +++ b/spec/build_tests_spec.rb @@ -89,7 +89,7 @@ describe Rscons do end def run_rscons(options = {}) - args = options[:args] || [] + args = Array(options[:args]) || [] if ENV["dist_specs"] exe = "#{@owd}/test/rscons.rb" else @@ -1754,10 +1754,10 @@ EOF expect(result.status).to_not eq 0 end - it "outputs an error for an unknown operation" do + it "outputs an error for an unknown task" do test_dir "simple" result = run_rscons(args: "unknownop") - expect(result.stderr).to match /Unknown operation: unknownop/ + expect(result.stderr).to match /Task 'unknownop' not found/ expect(result.status).to_not eq 0 end @@ -1774,7 +1774,7 @@ EOF test_dir "simple" result = run_rscons(args: %w[configure --xyz]) expect(result.stderr).to_not match /Traceback/ - expect(result.stderr).to match /invalid option.*--xyz/ + expect(result.stderr).to match /Invalid task 'configure' argument.*--xyz/ expect(result.stderr).to match /Usage:/ expect(result.status).to_not eq 0 end @@ -2424,16 +2424,6 @@ EOF expect(result.stderr).to eq "" expect(result.stdout).to match /gcc.*-o.*simple/ end - - it "prints operation start time" do - test_dir("simple") - result = run_rscons(args: %w[-v]) - expect(result.stderr).to eq "" - expect(result.stdout).to match /Starting 'configure' at/ - expect(result.stdout).to match /Starting 'build' at/ - expect(result.stdout).to match /'build' complete at/ - expect(result.stdout).to_not match /'configure' complete at/ - end end context "direct mode" do