diff options
Diffstat (limited to 'test/full')
-rw-r--r-- | test/full/example.lua | 3 | ||||
-rw-r--r-- | test/full/init.lua | 1 | ||||
-rw-r--r-- | test/full/self.lua | 29 |
3 files changed, 33 insertions, 0 deletions
diff --git a/test/full/example.lua b/test/full/example.lua index b19f0485..4f6090ee 100644 --- a/test/full/example.lua +++ b/test/full/example.lua @@ -41,6 +41,7 @@ local function testIfExit(path) local lines = parser:lines(buf) for i = 1, max do files.removeAll() + files.open('') files.setText('', buf) diag('', function () end) local passed = os.clock() - clock @@ -52,6 +53,8 @@ local function testIfExit(path) print(('基准诊断测试[%s]单次耗时:%.10f'):format(path:filename():string(), need)) end end + +require 'tracy' .enable() testIfExit(ROOT / 'test' / 'example' / 'vm.txt') testIfExit(ROOT / 'test' / 'example' / 'largeGlobal.txt') testIfExit(ROOT / 'test' / 'example' / 'guide.txt') diff --git a/test/full/init.lua b/test/full/init.lua index f370671e..ad34da7d 100644 --- a/test/full/init.lua +++ b/test/full/init.lua @@ -11,3 +11,4 @@ end require 'full.normal' require 'full.example' require 'full.dirty' +require 'full.self' diff --git a/test/full/self.lua b/test/full/self.lua new file mode 100644 index 00000000..247702ae --- /dev/null +++ b/test/full/self.lua @@ -0,0 +1,29 @@ +local files = require 'files' +local fsu = require 'fs-utility' +local furi = require 'file-uri' +local diag = require 'provider.diagnostic' +local config = require 'config' +files.removeAll() + +fsu.scanDirectory(ROOT, function (path) + if path:extension():string() ~= '.lua' then + return + end + local uri = furi.encode(path:string()) + local text = fsu.loadFile(path) + files.setText(uri, text) + files.open(uri) +end) + +config.config.diagnostics.disable['undefined-field'] = true +config.config.diagnostics.disable['redundant-parameter'] = true +diag.start() + +local clock = os.clock() + +for uri in files.eachFile() do + diag.doDiagnostic(uri) +end + +local passed = os.clock() - clock +print('基准全量诊断用时:', passed) |