test build hooks overwriting entire vars hash as a non-backwards-compatiblity test

This commit is contained in:
josh committed 2019-02-10 22:07:08 -05:00
1 parent 7992450383
commit a1f5f022d1
3 files changed
+29 -37

No files matched your search

+12 -12
View File
@@ -402,6 +402,18 @@ EOF
expect(`./build_hook.exe`).to eq "Hello from two()\n"
end
it 'supports build hooks to override the entire vars hash' do
test_dir("typical")
result = run_rscons(rsconscript: "build_hooks_override_vars.rb")
expect(result.stderr).to eq ""
expect(lines(result.stdout)).to include *[
'gcc -c -o one.o -MMD -MF one.mf -Isrc -Isrc/one -Isrc/two -O1 src/two/two.c',
'gcc -c -o two.o -MMD -MF two.mf -Isrc -Isrc/one -Isrc/two -O2 src/two/two.c'
]
expect(File.exists?('one.o')).to be_truthy
expect(File.exists?('two.o')).to be_truthy
end
it 'rebuilds when user-specified dependencies change' do
test_dir('simple')
@@ -851,18 +863,6 @@ EOF
expect(result.stderr).to match /Failed to build/
expect(result.stdout).to match /Failed command was: gcc/
end
it 'supports build hooks to override construction variables' do
test_dir("typical")
result = run_rscons(rsconscript: "backward_compatible_build_hooks.rb")
expect(result.stderr).to eq ""
expect(lines(result.stdout)).to include *[
'gcc -c -o one.o -MMD -MF one.mf -Isrc -Isrc/one -Isrc/two -O1 src/two/two.c',
'gcc -c -o two.o -MMD -MF two.mf -Isrc -Isrc/one -Isrc/two -O2 src/two/two.c'
]
expect(File.exists?('one.o')).to be_truthy
expect(File.exists?('two.o')).to be_truthy
end
end
context "CFile builder" do