Codelite: Add tests for pre/postbuildcommands with escaped char
This commit is contained in:
parent
37f9a09c0d
commit
3b31b6f054
@ -27,10 +27,9 @@
|
||||
end
|
||||
|
||||
function codelite.esc(value)
|
||||
local result = value:gsub('"', '\\"')
|
||||
local result = value:gsub('&', '&')
|
||||
result = result:gsub('<', '<')
|
||||
result = result:gsub('>', '>')
|
||||
result = result:gsub('&', '&')
|
||||
return result
|
||||
end
|
||||
|
||||
|
@ -17,6 +17,7 @@
|
||||
|
||||
function suite.setup()
|
||||
p.action.set("codelite")
|
||||
p.escaper(codelite.esc)
|
||||
p.indent(" ")
|
||||
wks = test.createWorkspace()
|
||||
end
|
||||
@ -198,6 +199,21 @@ cmd2</StartupCommands>
|
||||
]]
|
||||
end
|
||||
|
||||
function suite.OnProject_PreBuild_Escaped()
|
||||
prebuildcommands {
|
||||
"touch \"./build/copyright\" && echo OK",
|
||||
"cat \"./lib/copyright\" >> \"./build/copyright\""
|
||||
}
|
||||
prepare()
|
||||
codelite.project.preBuild(prj)
|
||||
test.capture [[
|
||||
<PreBuild>
|
||||
<Command Enabled="yes">touch "./build/copyright" && echo OK</Command>
|
||||
<Command Enabled="yes">cat "./lib/copyright" >> "./build/copyright"</Command>
|
||||
</PreBuild>
|
||||
]]
|
||||
end
|
||||
|
||||
function suite.OnProject_PostBuild()
|
||||
postbuildcommands { "cmd0", "cmd1" }
|
||||
prepare()
|
||||
@ -210,6 +226,21 @@ cmd2</StartupCommands>
|
||||
]]
|
||||
end
|
||||
|
||||
function suite.OnProject_PostBuild_Escaped()
|
||||
postbuildcommands {
|
||||
"touch \"./build/copyright\" && echo OK",
|
||||
"cat \"./lib/copyright\" >> \"./build/copyright\""
|
||||
}
|
||||
prepare()
|
||||
codelite.project.postBuild(prj)
|
||||
test.capture [[
|
||||
<PostBuild>
|
||||
<Command Enabled="yes">touch "./build/copyright" && echo OK</Command>
|
||||
<Command Enabled="yes">cat "./lib/copyright" >> "./build/copyright"</Command>
|
||||
</PostBuild>
|
||||
]]
|
||||
end
|
||||
|
||||
-- TODO: test custom build
|
||||
|
||||
|
||||
|
@ -17,6 +17,7 @@
|
||||
|
||||
function suite.setup()
|
||||
p.action.set("codelite")
|
||||
p.escaper(codelite.esc)
|
||||
p.indent(" ")
|
||||
wks = test.createWorkspace()
|
||||
end
|
||||
|
@ -18,6 +18,7 @@
|
||||
|
||||
function suite.setup()
|
||||
p.action.set("codelite")
|
||||
p.escaper(codelite.esc)
|
||||
p.indent(" ")
|
||||
wks = test.createWorkspace()
|
||||
end
|
||||
|
Reference in New Issue
Block a user