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|
|
Rscons::Environment.new do |env|
|
||||||
|
# CHANGE FLAGS
|
||||||
env.Program('simple', Dir['*.c'])
|
env.Program('simple', Dir['*.c'])
|
||||||
end
|
end
|
||||||
|
@ -97,11 +97,19 @@ describe Rscons do
|
|||||||
'CC header.o',
|
'CC header.o',
|
||||||
'LD header',
|
'LD header',
|
||||||
]
|
]
|
||||||
header_c = File.read('header.c')
|
file_sub('header.c') {|line| line}
|
||||||
File.open('header.c', 'w') do |fh|
|
|
||||||
fh.write(header_c)
|
|
||||||
end
|
|
||||||
lines = build_testdir
|
lines = build_testdir
|
||||||
lines.should == []
|
lines.should == []
|
||||||
end
|
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
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user