Fix up some configure tests
This commit is contained in:
parent
7189a04299
commit
679c013eaa
@ -1,3 +1,4 @@
|
||||
configure do
|
||||
check_c_compiler "nope.nope"
|
||||
end
|
||||
default
|
||||
|
@ -1 +0,0 @@
|
||||
autoconf false
|
@ -1,3 +1,4 @@
|
||||
configure do
|
||||
check_c_compiler
|
||||
end
|
||||
default
|
||||
|
@ -1,3 +0,0 @@
|
||||
Environment.new do |env|
|
||||
env.Object("simple.o", "simple.cc")
|
||||
end
|
@ -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
|
||||
end
|
||||
end
|
||||
|
||||
# Show the last failures.
|
||||
|
@ -118,6 +118,7 @@ module Rscons
|
||||
end
|
||||
end
|
||||
|
||||
begin
|
||||
# Load the build script.
|
||||
if rsconscript
|
||||
Rscons.application.script.load(rsconscript)
|
||||
@ -151,6 +152,10 @@ module Rscons
|
||||
# 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
|
||||
end
|
||||
|
||||
def usage
|
||||
|
@ -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
|
||||
|
@ -2365,13 +2365,6 @@ EOF
|
||||
expect(result.stdout).to match /gcc.*-o.*\.o.*-DHAVE_MATH_H\s.*-DHAVE_STDIO_H/
|
||||
end
|
||||
|
||||
it "exits with an error if the project is not configured and a build is requested and autoconf is false" do
|
||||
test_dir "configure"
|
||||
result = run_rscons(args: %w[-f autoconf_false.rb])
|
||||
expect(result.stderr).to match /Project must be configured first, and autoconf is disabled/
|
||||
expect(result.status).to_not eq 0
|
||||
end
|
||||
|
||||
it "exits with an error code and message if configuration fails during autoconf" do
|
||||
test_dir "configure"
|
||||
result = run_rscons(args: %w[-f autoconf_fail.rb])
|
||||
@ -2381,13 +2374,6 @@ EOF
|
||||
expect(lines(result.stderr).last).to eq "Configuration failed"
|
||||
end
|
||||
|
||||
it "exits with an error if configuration has not been performed before attempting to create an environment" do
|
||||
test_dir "configure"
|
||||
result = run_rscons(args: %w[-f error_env_construction_before_configure.rb])
|
||||
expect(result.stderr).to match /Project must be configured before creating an Environment/
|
||||
expect(result.status).to_not eq 0
|
||||
end
|
||||
|
||||
it "does not rebuild after building with auto-configuration" do
|
||||
test_dir "configure"
|
||||
result = run_rscons(args: %w[-f autoconf_rebuild.rb])
|
||||
|
Loading…
x
Reference in New Issue
Block a user