diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/full/example.lua | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/test/full/example.lua b/test/full/example.lua index 4f6090ee..a7df10db 100644 --- a/test/full/example.lua +++ b/test/full/example.lua @@ -3,6 +3,8 @@ local parser = require 'parser' local files = require 'files' local diag = require 'core.diagnostics' local config = require 'config' +local fs = require 'bee.filesystem' +local luadoc = require "parser.luadoc" -- 临时 local function testIfExit(path) @@ -16,23 +18,29 @@ local function testIfExit(path) local need local parseClock = 0 local compileClock = 0 + local luadocClock = 0 local total for i = 1, max do vm = TEST(buf) + local luadocStart = os.clock() + luadoc(nil, vm) + local luadocPassed = os.clock() - luadocStart local passed = os.clock() - clock - parseClock = parseClock + vm.parseClock + parseClock = parseClock + vm.parseClock compileClock = compileClock + vm.compileClock + luadocClock = luadocClock + luadocPassed if passed >= 1.0 or i == max then need = passed / i total = i break end end - print(('基准编译测试[%s]单次耗时:%.10f(解析:%.10f, 编译:%.10f)'):format( + print(('基准编译测试[%s]单次耗时:%.10f(解析:%.10f, 编译:%.10f, LuaDoc: %.10f)'):format( path:filename():string(), need, parseClock / total, - compileClock / total + compileClock / total, + luadocClock / total )) local clock = os.clock() @@ -58,3 +66,4 @@ require 'tracy' .enable() testIfExit(ROOT / 'test' / 'example' / 'vm.txt') testIfExit(ROOT / 'test' / 'example' / 'largeGlobal.txt') testIfExit(ROOT / 'test' / 'example' / 'guide.txt') +testIfExit(fs.path [[D:\github\test\ECObject.lua]]) |