add Environment#dump
This commit is contained in:
parent
d5e0475e6c
commit
d9e3129ad5
@ -660,6 +660,13 @@ module Rscons
|
||||
end
|
||||
end
|
||||
|
||||
# Print the Environment's construction variables for debugging.
|
||||
def dump
|
||||
@varset.to_h.sort.each do |var, val|
|
||||
puts "#{var} => #{val.inspect}"
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
# Expand target and source paths before invoking builders.
|
||||
|
@ -721,4 +721,15 @@ EOF
|
||||
expect(`./two_sources`).to eq "This is a C program with two sources.\n"
|
||||
end
|
||||
|
||||
it "supports dumping an Environment's construction variables" do
|
||||
test_dir("simple")
|
||||
env = Rscons::Environment.new do |env|
|
||||
env["CFLAGS"] += %w[-O2 -fomit-frame-pointer]
|
||||
end
|
||||
env.dump
|
||||
result = lines
|
||||
expect(result.include?(%{CFLAGS => ["-O2", "-fomit-frame-pointer"]})).to be_truthy
|
||||
expect(result.include?(%{CPPPATH => []})).to be_truthy
|
||||
end
|
||||
|
||||
end
|
||||
|
Loading…
x
Reference in New Issue
Block a user