2021-07-02 05:15:40 -07:00
|
|
|
local helpers = require('test.functional.helpers')(after_each)
|
|
|
|
local clear = helpers.clear
|
|
|
|
local eval = helpers.eval
|
|
|
|
local has_powershell = helpers.has_powershell
|
|
|
|
local matches = helpers.matches
|
2024-01-12 10:59:57 -07:00
|
|
|
local api = helpers.api
|
2022-06-22 05:51:52 -07:00
|
|
|
local testprg = helpers.testprg
|
2021-07-02 05:15:40 -07:00
|
|
|
|
|
|
|
describe(':make', function()
|
|
|
|
clear()
|
|
|
|
before_each(function()
|
|
|
|
clear()
|
|
|
|
end)
|
|
|
|
|
|
|
|
describe('with powershell', function()
|
|
|
|
if not has_powershell() then
|
|
|
|
pending('not tested; powershell was not found', function() end)
|
|
|
|
return
|
|
|
|
end
|
|
|
|
before_each(function()
|
|
|
|
helpers.set_shell_powershell()
|
|
|
|
end)
|
|
|
|
|
|
|
|
it('captures stderr & non zero exit code #14349', function()
|
2024-01-12 10:59:57 -07:00
|
|
|
api.nvim_set_option_value('makeprg', testprg('shell-test') .. ' foo', {})
|
2021-07-02 05:15:40 -07:00
|
|
|
local out = eval('execute("make")')
|
|
|
|
-- Error message is captured in the file and printed in the footer
|
2023-04-22 03:04:05 -07:00
|
|
|
matches(
|
|
|
|
'[\r\n]+.*[\r\n]+Unknown first argument%: foo[\r\n]+%(1 of 1%)%: Unknown first argument%: foo',
|
|
|
|
out
|
|
|
|
)
|
2021-07-02 05:15:40 -07:00
|
|
|
end)
|
|
|
|
|
|
|
|
it('captures stderr & zero exit code #14349', function()
|
2024-01-12 10:59:57 -07:00
|
|
|
api.nvim_set_option_value('makeprg', testprg('shell-test'), {})
|
2021-07-02 05:15:40 -07:00
|
|
|
local out = eval('execute("make")')
|
|
|
|
-- Ensure there are no "shell returned X" messages between
|
2023-03-19 14:25:12 -07:00
|
|
|
-- command and last line (indicating zero exit)
|
|
|
|
matches('LastExitCode%s+ready [$]%s+[(]', out)
|
2021-07-02 05:15:40 -07:00
|
|
|
matches('\n.*%: ready [$]', out)
|
|
|
|
end)
|
|
|
|
end)
|
|
|
|
end)
|