add Rscons.vars back again at least for now
This commit is contained in:
parent
8d766e4804
commit
053df2360f
@ -17,7 +17,7 @@ class DebugBuilder < Rscons::Builder
|
|||||||
strict_deps = true
|
strict_deps = true
|
||||||
end
|
end
|
||||||
unless cache.up_to_date?(target, command, sources, env, debug: true, strict_deps: strict_deps)
|
unless cache.up_to_date?(target, command, sources, env, debug: true, strict_deps: strict_deps)
|
||||||
desc = "#{self.class.name} #{target}"
|
desc = "#{name} #{target}"
|
||||||
return false unless env.execute(desc, command)
|
return false unless env.execute(desc, command)
|
||||||
cache.register_build(target, command, sources, env)
|
cache.register_build(target, command, sources, env)
|
||||||
end
|
end
|
||||||
|
@ -57,6 +57,13 @@ module Rscons
|
|||||||
@application ||= Application.new
|
@application ||= Application.new
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# Access any variables set on the rscons command-line.
|
||||||
|
#
|
||||||
|
# @return [VarSet]
|
||||||
|
def vars(*args)
|
||||||
|
application.vars(*args)
|
||||||
|
end
|
||||||
|
|
||||||
# Return whether the given path is an absolute filesystem path.
|
# Return whether the given path is an absolute filesystem path.
|
||||||
#
|
#
|
||||||
# @param path [String] the path to examine.
|
# @param path [String] the path to examine.
|
||||||
|
@ -1287,6 +1287,7 @@ EOF
|
|||||||
it "prints a message when the target does not exist" do
|
it "prints a message when the target does not exist" do
|
||||||
test_dir("simple")
|
test_dir("simple")
|
||||||
result = run_rscons(rsconsfile: "cache_debugging.rb")
|
result = run_rscons(rsconsfile: "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/
|
expect(result.stdout).to match /Target foo\.o needs rebuilding because it does not exist on disk/
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -1294,54 +1295,67 @@ EOF
|
|||||||
test_dir("simple")
|
test_dir("simple")
|
||||||
FileUtils.touch("foo.o")
|
FileUtils.touch("foo.o")
|
||||||
result = run_rscons(rsconsfile: "cache_debugging.rb")
|
result = run_rscons(rsconsfile: "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/
|
expect(result.stdout).to match /Target foo\.o needs rebuilding because there is no cached build information for it/
|
||||||
end
|
end
|
||||||
|
|
||||||
it "prints a message when the target file has changed on disk" do
|
it "prints a message when the target file has changed on disk" do
|
||||||
test_dir("simple")
|
test_dir("simple")
|
||||||
result = run_rscons(rsconsfile: "cache_debugging.rb")
|
result = run_rscons(rsconsfile: "cache_debugging.rb")
|
||||||
|
expect(result.stderr).to eq ""
|
||||||
File.open("foo.o", "wb") {|fh| fh.puts "hi"}
|
File.open("foo.o", "wb") {|fh| fh.puts "hi"}
|
||||||
result = run_rscons(rsconsfile: "cache_debugging.rb")
|
result = run_rscons(rsconsfile: "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/
|
expect(result.stdout).to match /Target foo\.o needs rebuilding because it has been changed on disk since being built last/
|
||||||
end
|
end
|
||||||
|
|
||||||
it "prints a message when the command has changed" do
|
it "prints a message when the command has changed" do
|
||||||
test_dir("simple")
|
test_dir("simple")
|
||||||
result = run_rscons(rsconsfile: "cache_debugging.rb")
|
result = run_rscons(rsconsfile: "cache_debugging.rb")
|
||||||
|
expect(result.stderr).to eq ""
|
||||||
result = run_rscons(rsconsfile: "cache_debugging.rb", op: %w[build command_change=yes])
|
result = run_rscons(rsconsfile: "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/
|
expect(result.stdout).to match /Target foo\.o needs rebuilding because the command used to build it has changed/
|
||||||
end
|
end
|
||||||
|
|
||||||
it "prints a message when strict_deps is in use and the set of dependencies does not match" do
|
it "prints a message when strict_deps is in use and the set of dependencies does not match" do
|
||||||
test_dir("simple")
|
test_dir("simple")
|
||||||
result = run_rscons(rsconsfile: "cache_debugging.rb", op: %w[build strict_deps1=yes])
|
result = run_rscons(rsconsfile: "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(rsconsfile: "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/
|
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
|
end
|
||||||
|
|
||||||
it "prints a message when there is a new dependency" do
|
it "prints a message when there is a new dependency" do
|
||||||
test_dir("simple")
|
test_dir("simple")
|
||||||
result = run_rscons(rsconsfile: "cache_debugging.rb")
|
result = run_rscons(rsconsfile: "cache_debugging.rb")
|
||||||
|
expect(result.stderr).to eq ""
|
||||||
result = run_rscons(rsconsfile: "cache_debugging.rb", op: %w[build new_dep=yes])
|
result = run_rscons(rsconsfile: "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/
|
expect(result.stdout).to match /Target foo\.o needs rebuilding because there are new dependencies/
|
||||||
end
|
end
|
||||||
|
|
||||||
it "prints a message when there is a new user-specified dependency" do
|
it "prints a message when there is a new user-specified dependency" do
|
||||||
test_dir("simple")
|
test_dir("simple")
|
||||||
result = run_rscons(rsconsfile: "cache_debugging.rb")
|
result = run_rscons(rsconsfile: "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(rsconsfile: "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/
|
expect(result.stdout).to match /Target foo\.o needs rebuilding because the set of user-specified dependency files has changed/
|
||||||
end
|
end
|
||||||
|
|
||||||
it "prints a message when a dependency file has changed" do
|
it "prints a message when a dependency file has changed" do
|
||||||
test_dir("simple")
|
test_dir("simple")
|
||||||
result = run_rscons(rsconsfile: "cache_debugging.rb")
|
result = run_rscons(rsconsfile: "cache_debugging.rb")
|
||||||
|
expect(result.stderr).to eq ""
|
||||||
f = File.read("simple.c", mode: "rb")
|
f = File.read("simple.c", mode: "rb")
|
||||||
f += "\n"
|
f += "\n"
|
||||||
File.open("simple.c", "wb") do |fh|
|
File.open("simple.c", "wb") do |fh|
|
||||||
fh.write(f)
|
fh.write(f)
|
||||||
end
|
end
|
||||||
result = run_rscons(rsconsfile: "cache_debugging.rb")
|
result = run_rscons(rsconsfile: "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/
|
expect(result.stdout).to match /Target foo\.o needs rebuilding because dependency file simple\.c has changed/
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user