Fix up some configure tests

This commit is contained in:
josh committed 2022-01-26 21:46:07 -05:00
1 parent 7189a04299
commit 679c013eaa
8 files changed
+44 -62

No files matched your search

+4 -11
View File
@@ -41,22 +41,15 @@ module Rscons
#
# @param tasks [Array<String>]
# List of task(s) to execute.
# @param options [Hash]
# Optional parameters.
#
# @return [Integer]
# Process exit code (0 on success).
def run(tasks, options = {})
def run(tasks)
Cache.instance["failed_commands"] = []
begin
tasks.each do |task|
Task[task].check_execute
end
0
rescue RsconsError => e
Ansi.write($stderr, :red, e.message, :reset, "\n")
1
tasks.each do |task|
Task[task].check_execute
end
0
end
# Show the last failures.
+37 -32
View File
@@ -118,39 +118,44 @@ module Rscons
end
end
# Load the build script.
if rsconscript
Rscons.application.script.load(rsconscript)
begin
# Load the build script.
if rsconscript
Rscons.application.script.load(rsconscript)
end
# Do help after loading the build script (if found) so that any
# script-defined tasks and task options can be displayed.
if do_help
puts usage
return 0
end
# Anything else requires a build script, so complain if we didn't find
# one.
unless rsconscript
$stderr.puts "Could not find the Rsconscript to execute."
$stderr.puts "Looked for: #{DEFAULT_RSCONSCRIPTS.join(", ")}"
return 1
end
# Parse the rest of the command line. This is done after loading the
# build script so that script-defined tasks and task options can be
# taken into account.
tasks = parse_tasks_and_params(argv)
# If no user specified tasks, run "default" task.
if tasks.empty?
tasks << "default"
end
# Finally, with the script fully loaded and command-line parsed, run
# the application to execute all required tasks.
Rscons.application.run(tasks)
rescue RsconsError => e
Ansi.write($stderr, :red, e.message, :reset, "\n")
1
end
# Do help after loading the build script (if found) so that any
# script-defined tasks and task options can be displayed.
if do_help
puts usage
return 0
end
# Anything else requires a build script, so complain if we didn't find
# one.
unless rsconscript
$stderr.puts "Could not find the Rsconscript to execute."
$stderr.puts "Looked for: #{DEFAULT_RSCONSCRIPTS.join(", ")}"
return 1
end
# Parse the rest of the command line. This is done after loading the
# build script so that script-defined tasks and task options can be
# taken into account.
tasks = parse_tasks_and_params(argv)
# If no user specified tasks, run "default" task.
if tasks.empty?
tasks << "default"
end
# Finally, with the script fully loaded and command-line parsed, run
# the application to execute all required tasks.
Rscons.application.run(tasks)
end
def usage
+1 -1
View File
@@ -396,7 +396,7 @@ module Rscons
options[:on_fail].call
end
if should_fail
raise RsconsError.new
raise RsconsError.new("Configuration failed")
end
end
end