test re-invoking a builder if the command-line options change
This commit is contained in:
parent
82cdca77f1
commit
141f8ad5ac
@ -1,3 +1,4 @@
|
||||
Rscons::Environment.new do |env|
|
||||
# CHANGE FLAGS
|
||||
env.Program('simple', Dir['*.c'])
|
||||
end
|
||||
|
@ -97,11 +97,19 @@ describe Rscons do
|
||||
'CC header.o',
|
||||
'LD header',
|
||||
]
|
||||
header_c = File.read('header.c')
|
||||
File.open('header.c', 'w') do |fh|
|
||||
fh.write(header_c)
|
||||
end
|
||||
file_sub('header.c') {|line| line}
|
||||
lines = build_testdir
|
||||
lines.should == []
|
||||
end
|
||||
|
||||
it 're-links a program when the link flags have changed' do
|
||||
lines = test_dir('simple')
|
||||
lines.should == [
|
||||
'gcc -c -o simple.o -MMD -MF simple.mf simple.c',
|
||||
'gcc -o simple simple.o',
|
||||
]
|
||||
file_sub('build.rb') {|line| line.sub(/.*CHANGE.FLAGS.*/, ' env["LIBS"] += ["c"]')}
|
||||
lines = build_testdir
|
||||
lines.should == ['gcc -o simple simple.o -lc']
|
||||
end
|
||||
end
|
||||
|
Loading…
x
Reference in New Issue
Block a user