summaryrefslogtreecommitdiff
path: root/test/full/init.lua
blob: e83a7d6d147acff833a3c0232bb744e4b2621f42 (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
30
31
32
33
34
local parser  = require 'parser'
local config  = require 'config'
local util    = require 'utility'

rawset(_G, 'TEST', true)

function TEST(script)
    local clock = os.clock()
    local state = parser.compile(script, 'Lua', 'Lua 5.3')
    state.compileClock = os.clock() - clock
    return state
end

local function startCollectDiagTimes()
    for name in pairs(config.get(nil, 'Lua.diagnostics.neededFileStatus')) do
        if name ~= 'no-implicit-any' then
            --config.get(nil, 'Lua.diagnostics.neededFileStatus')[name] = 'Any'
        end
    end
    DIAGTIMES = {}
end

startCollectDiagTimes()
require 'full.normal'
require 'full.example'
require 'full.dirty'
require 'full.projects'
require 'full.self'

for name, time in util.sortPairs(DIAGTIMES, function (k1, k2)
    return DIAGTIMES[k1] < DIAGTIMES[k2]
end) do
    print('诊断任务耗时:', name, time)
end