summaryrefslogtreecommitdiff
path: root/test/full/self.lua
blob: 247702ae4ef62c46cf1a3c62c6133bdf1cc52819 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
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)