blob: fe2efd237dc4dbd6d6ecc3b6ac3278ff98713ffa (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
local fs = require 'bee.filesystem'
local subprocess = require 'bee.subprocess'
ROOT = fs.current_path()
package.path = (ROOT / 'src' / '?.lua'):string()
.. ';' .. (ROOT / 'src' / '?' / 'init.lua'):string()
local function runTest(root)
local exe = root / 'bin' / 'lua-language-server'
local test = root / 'test' / 'main.lua'
local lua = subprocess.spawn {
exe,
test,
'-E',
stdout = true,
stderr = true,
}
for line in lua.stdout:lines 'l' do
print(line)
end
lua:wait()
local err = lua.stderr:read 'a'
if err ~= '' then
error(err)
end
end
runTest(ROOT)
|