Merge pull request #1045 from tdesveauxPKFX/debuggerflavor

Add debuggerflavor API
This commit is contained in:
Samuel Surtees 2018-04-11 18:48:03 +10:00 committed by GitHub
commit dc641e5c69
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 41 additions and 1 deletions

View File

@ -116,6 +116,17 @@
tokens = true,
}
p.api.register {
name = "debuggerflavor",
scope = "config",
kind = "string",
allowed = {
"Local",
"Remote",
"WebBrowser",
"WebService"
}
}
--
-- Decide when the full module should be loaded.

View File

@ -101,3 +101,22 @@ foo=bar</LocalDebuggerEnvironment>
]]
end
--
-- Test Debugger Flavor
--
function suite.debuggerFlavor_OnWindowsLocal()
debuggerflavor "Local"
prepare()
test.capture [[
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
]]
end
function suite.debuggerFlavor_OnWindowsRemote()
debuggerflavor "Remote"
prepare()
test.capture [[
<DebuggerFlavor>WindowsRemoteDebugger</DebuggerFlavor>
]]
end

View File

@ -79,7 +79,17 @@
function m.debuggerFlavor(cfg)
if cfg.debugdir or cfg.debugcommand then
local map = {
Local = "WindowsLocalDebugger",
Remote = "WindowsRemoteDebugger",
WebBrowser = "WebBrowserDebugger",
WebService = "WebServiceDebugger"
}
local value = map[cfg.debuggerflavor]
if value then
p.w('<DebuggerFlavor>%s</DebuggerFlavor>', value)
elseif cfg.debugdir or cfg.debugcommand then
p.w('<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>')
end
end