summaryrefslogtreecommitdiff
path: root/server/test/main.lua
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2018-11-20 18:40:33 +0800
committer最萌小汐 <sumneko@hotmail.com>2018-11-20 18:40:33 +0800
commit67f6a20b27c98788843883c3712c648e110d781f (patch)
tree209705e0bc3c2c44d5ffade78cc2c7041eeffdda /server/test/main.lua
parenta65a1ddb13854c2dfde4c04630a0a942abdafa32 (diff)
downloadlua-language-server-67f6a20b27c98788843883c3712c648e110d781f.zip
转移目录
Diffstat (limited to 'server/test/main.lua')
-rw-r--r--server/test/main.lua31
1 files changed, 31 insertions, 0 deletions
diff --git a/server/test/main.lua b/server/test/main.lua
new file mode 100644
index 00000000..c33526c6
--- /dev/null
+++ b/server/test/main.lua
@@ -0,0 +1,31 @@
+require 'filesystem'
+ROOT = fs.current_path()
+package.path = (ROOT / 'src' / '?.lua'):string()
+ .. ';' .. (ROOT / 'src' / '?' / 'init.lua'):string()
+ .. ';' .. (ROOT / 'test' / '?.lua'):string()
+ .. ';' .. (ROOT / 'test' / '?' / 'init.lua'):string()
+
+log = require 'log'
+log.init(ROOT, ROOT / 'log' / 'test.log')
+log.debug('测试开始')
+
+require 'utility'
+require 'global_protect'
+
+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 'definition'
+ test 'implementation'
+
+ print('测试完成')
+end
+
+main()
+
+log.debug('测试完成')