2024-04-20 08:44:13 -07:00
|
|
|
local t = require('test.testutil')
|
|
|
|
local n = require('test.functional.testnvim')()
|
|
|
|
|
|
|
|
local clear = n.clear
|
|
|
|
local eval = n.eval
|
|
|
|
local has_powershell = n.has_powershell
|
2024-04-08 02:03:20 -07:00
|
|
|
local matches = t.matches
|
2024-04-20 08:44:13 -07:00
|
|
|
local api = n.api
|
|
|
|
local testprg = n.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()
|
2024-04-20 08:44:13 -07:00
|
|
|
n.set_shell_powershell()
|
2021-07-02 05:15:40 -07:00
|
|
|
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)
|