assert(type(RUNNER_PATH)=="\115\116\114\105\110\103")assert(type(TESTEZ_PATH)=="\115\116\114\105\110\103")assert(type(SRC_PATH)=="\115\116\114\105\110\103")assert(type(DEPS)=="\116\097\098\108\101"or DEPS==nil)local a=require("\108\101\109\117\114")local O=a.Habitat.new()local Y=O.game:GetService("\082\101\112\108\105\099\097\116\101\100\083\116\111\114\097\103\101")local m=O:loadFromFs(RUNNER_PATH)m.Name="\084\101\115\116\082\117\110\110\101\114"m.Parent=Y local S=O:loadFromFs(TESTEZ_PATH)S.Name="\084\101\115\116\069\090"S.Parent=m local E=O:loadFromFs(SRC_PATH)E.Parent=Y _G.TESTEZ_TEST_CONTAINERS={E}if DEPS~=nil then if DEPS.kind=="\114\111\116\114\105\101\118\101\114"then local a=O:loadFromFs(DEPS.packagesPath)for a,O in ipairs(a:GetChildren())do O.Parent=Y end elseif DEPS.kind=="\103\105\116-\115\117\098\109\111\100\117\108\101\115"then for a,m in ipairs(DEPS.modules)do local S=O:loadFromFs(m[1])S.Name=m[2]S.Parent=Y end else error(string.format("\085\110\115\117\112\112\111\114\116\101\100 \100\101\112\101\110\100\101\110\099\121 \108\105\115\116 \107\105\110\100 \037\113",tostring(DEPS.kind)))end end O:require(m)
-- This module has variables preprended to it by the TestEZ CLI that inform it
-- what modules need to be loaded.

-- luacheck: globals RUNNER_PATH TESTEZ_PATH SRC_PATH DEPS

assert(type(RUNNER_PATH) == "string")
assert(type(TESTEZ_PATH) == "string")
assert(type(SRC_PATH) == "string")
assert(type(DEPS) == "table" or DEPS == nil)

local lemur = require("lemur")

local habitat = lemur.Habitat.new()

local ReplicatedStorage = habitat.game:GetService("ReplicatedStorage")

local testRunner = habitat:loadFromFs(RUNNER_PATH)
testRunner.Name = "TestRunner"
testRunner.Parent = ReplicatedStorage

local testez = habitat:loadFromFs(TESTEZ_PATH)
testez.Name = "TestEZ"
testez.Parent = testRunner

local source = habitat:loadFromFs(SRC_PATH)
-- TODO: Library name?
source.Parent = ReplicatedStorage

_G.TESTEZ_TEST_CONTAINERS = { source }

if DEPS ~= nil then
	if DEPS.kind == "rotriever" then
		local packages = habitat:loadFromFs(DEPS.packagesPath)

		for _, dir in ipairs(packages:GetChildren()) do
			dir.Parent = ReplicatedStorage
		end
	elseif DEPS.kind == "git-submodules" then
		for _, dep in ipairs(DEPS.modules) do
			local container = habitat:loadFromFs(dep[1])
			container.Name = dep[2]
			container.Parent = ReplicatedStorage
		end
	else
		error(string.format("Unsupported dependency list kind %q", tostring(DEPS.kind)))
	end
end

habitat:require(testRunner)