Skip to content

Commit

Permalink
Handle 'Full' and 'FastLink' arguments to 'symbols'. Add associated g…
Browse files Browse the repository at this point in the history
…make and gmake2 tests
  • Loading branch information
ratzlaff committed Nov 13, 2018
1 parent acd8b5c commit a364392
Show file tree
Hide file tree
Showing 3 changed files with 71 additions and 1 deletion.
33 changes: 33 additions & 0 deletions modules/gmake/tests/cpp/test_flags.lua
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,39 @@
]]
end

--
-- symbols default to 'off'
--
function suite.symbols_default()
symbols "default"
prepare { "cFlags", "cxxFlags" }
test.capture [[
ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS)
ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS)
]]
end

--
-- All other symbols flags also produce -g
--
function suite.symbols_fastlink()
symbols "FastLink"
prepare { "cFlags", "cxxFlags" }
test.capture [[
ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -g
ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -g
]]
end

function suite.symbols_full()
symbols "full"
prepare { "cFlags", "cxxFlags" }
test.capture [[
ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -g
ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -g
]]
end

--
-- symbols "off" should not produce -g
--
Expand Down
33 changes: 33 additions & 0 deletions modules/gmake2/tests/test_gmake2_flags.lua
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,18 @@ ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -g
]]
end

--
-- symbols default to 'off'
--
function suite.symbols_default()
symbols "default"
prepare { "cFlags", "cxxFlags" }
test.capture [[
ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS)
ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS)
]]
end

--
-- symbols "off" should not produce -g
--
Expand All @@ -65,6 +77,27 @@ ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS)
]]
end

--
-- All other symbols flags also produce -g
--
function suite.symbols_fastlink()
symbols "FastLink"
prepare { "cFlags", "cxxFlags" }
test.capture [[
ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -g
ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -g
]]
end

function suite.symbols_full()
symbols "full"
prepare { "cFlags", "cxxFlags" }
test.capture [[
ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -g
ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -g
]]
end

--
-- symbols "on" with a proper debugformat should produce a corresponding -g
--
Expand Down
6 changes: 5 additions & 1 deletion src/tools/gcc.lua
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,11 @@
symbols = function(cfg, mappings)
local values = gcc.getdebugformat(cfg)
local debugformat = values[cfg.debugformat] or ""
return { On = "-g" .. debugformat }
return {
On = "-g" .. debugformat,
FastLink = "-g" .. debugformat,
Full = "-g" .. debugformat,
}
end,
unsignedchar = {
On = "-funsigned-char",
Expand Down

0 comments on commit a364392

Please sign in to comment.