summaryrefslogtreecommitdiff
path: root/make/unittest.lua
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2019-06-15 19:51:54 +0800
committer最萌小汐 <sumneko@hotmail.com>2019-06-15 19:51:54 +0800
commita455c8309a85c573066e233ef9cf8d9cae8836e6 (patch)
tree4c8dc49cc9da5abd9cb1463dac06e97176d13ff0 /make/unittest.lua
parent4eadbf384b56c6106f98cefa173faab6e5b0a6fb (diff)
downloadlua-language-server-a455c8309a85c573066e233ef9cf8d9cae8836e6.zip
编译后跑一遍单元测试
Diffstat (limited to 'make/unittest.lua')
-rw-r--r--make/unittest.lua23
1 files changed, 23 insertions, 0 deletions
diff --git a/make/unittest.lua b/make/unittest.lua
new file mode 100644
index 00000000..a3daa254
--- /dev/null
+++ b/make/unittest.lua
@@ -0,0 +1,23 @@
+local platform = ...
+local fs = require 'bee.filesystem'
+local sp = require 'bee.subprocess'
+local exe = platform == 'msvc' and ".exe" or ""
+
+local CWD = fs.current_path()
+
+local process = assert(sp.spawn {
+ CWD / 'server' / 'bin' / ('lua-language-server' .. exe),
+ CWD / 'server' / 'test.lua',
+ '-E',
+ stdout = true,
+ stderr = true,
+})
+
+for line in process.stdout:lines 'l' do
+ print(line)
+end
+process:wait()
+local err = process.stderr:read 'a'
+if err ~= '' then
+ error(err)
+end