diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2019-11-22 23:26:32 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2019-11-22 23:26:32 +0800 |
commit | d0ff66c9abe9d6abbca12fd811e0c3cb69c1033a (patch) | |
tree | bb34518d70b85de7656dbdbe958dfa221a3ff3b3 /script/test.lua | |
parent | 0a2c2ad15e1ec359171fb0dd4c72e57c5b66e9ba (diff) | |
download | lua-language-server-d0ff66c9abe9d6abbca12fd811e0c3cb69c1033a.zip |
整理一下目录结构
Diffstat (limited to 'script/test.lua')
-rw-r--r-- | script/test.lua | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/script/test.lua b/script/test.lua new file mode 100644 index 00000000..5e238049 --- /dev/null +++ b/script/test.lua @@ -0,0 +1,61 @@ +local currentPath = debug.getinfo(1, 'S').source:sub(2) +local rootPath = currentPath:gsub('[^/\\]-$', '') +if rootPath == '' then + rootPath = './' +end +dofile(rootPath .. 'platform.lua') +package.path = package.path + .. ';' .. rootPath .. 'test/?.lua' + .. ';' .. rootPath .. 'test/?/init.lua' +local fs = require 'bee.filesystem' +ROOT = fs.absolute(fs.path(rootPath):parent_path()) +LANG = 'en-US' + +log = require 'log' +log.init(ROOT, ROOT / 'log' / 'test.log') +log.debug('测试开始') +ac = {} + +require 'utility' +dofile((ROOT / 'build_package.lua'):string()) + +local function loadAllLibs() + assert(require 'bee.filesystem') + assert(require 'bee.subprocess') + assert(require 'bee.thread') + assert(require 'bee.socket') + assert(require 'lni') + assert(require 'lpeglabel') +end + +local function main() + local function test(name) + local clock = os.clock() + print(('测试[%s]...'):format(name)) + require(name) + print(('测试[%s]用时[%.3f]'):format(name, os.clock() - clock)) + end + + test 'core' + test 'definition' + test 'rename' + test 'highlight' + test 'references' + test 'diagnostics' + test 'type_inference' + test 'find_lib' + test 'hover' + test 'completion' + test 'signature' + test 'document_symbol' + test 'crossfile' + test 'full' + test 'other' + + print('测试完成') +end + +loadAllLibs() +main() + +log.debug('测试完成') |