local DumpCoverage = require "DumpCoverage"
local AgLuaCoverage = require "AgLuaCoverage"
local KSIdGenerator = require 'KSIdGenerator'

--------------------------------------------------------------------------------

local function dumpCoverage( dir )
	local time = os.date("%H.%M.%S")
	local uuid = KSIdGenerator.uuid();
	local filename = string.format( "/%s-%s.lcr", time, uuid )
	local fullpath = dir..filename
	local results = AgLuaCoverage.currentResults( true )
	DumpCoverage.updateCoverageLog( results, fullpath )
end

--------------------------------------------------------------------------------

return {
	dumpCoverage = dumpCoverage,
}
