add configure spec to check multiple set_define's being stored

This commit is contained in:
Josh Holtrop 2018-11-29 22:14:10 -05:00
parent 0e27e967d0
commit c0a28d0207
2 changed files with 19 additions and 0 deletions

View File

@ -0,0 +1,8 @@
configure do
check_c_header "math.h", set_define: "HAVE_MATH_H"
check_c_header "stdio.h", set_define: "HAVE_STDIO_H"
end
Rscons::Environment.new(echo: :command) do |env|
env.Object("simple.o", "simple.c")
end

View File

@ -1885,6 +1885,17 @@ EOF
expect(result.stdout).to match /Checking for library 'm'\.\.\. found/ expect(result.stdout).to match /Checking for library 'm'\.\.\. found/
expect(result.stdout).to match /Checking for program 'ls'\.\.\. .*ls/ expect(result.stdout).to match /Checking for program 'ls'\.\.\. .*ls/
end end
it "aggregates multiple set_define's" do
test_dir "configure"
result = run_rscons(rsconscript: "multiple_set_define.rb", op: "configure")
expect(result.stderr).to eq ""
expect(result.status).to eq 0
result = run_rscons(rsconscript: "multiple_set_define.rb", op: "build")
expect(result.stderr).to eq ""
expect(result.status).to eq 0
expect(result.stdout).to match /gcc.*-o.*\.o.*-DHAVE_MATH_H\s.*-DHAVE_STDIO_H/
end
end end
end end