function TestSession.setStatusFromChildren(a)assert(#a.nodeStack>0,"\065\116\116\101\109\112\116\105\110\103 \116\111 \115\101\116 \115\116\097\116\117\115 \102\114\111\109 \099\104\105\108\100\114\101\110 \111\110 \101\109\112\116\121 \115\116\097\099\107")local y=a.nodeStack[#a.nodeStack]local e=TestEnum.TestStatus.Success local g=true for a,y in ipairs(y.children)do if y.status~=TestEnum.TestStatus.Skipped then g=false if y.status==TestEnum.TestStatus.Failure then e=TestEnum.TestStatus.Failure end end end if g then e=TestEnum.TestStatus.Skipped end y.status=e end return TestSession

function TestSession:setStatusFromChildren()
	assert(#self.nodeStack > 0, "Attempting to set status from children on empty stack")

	local last = self.nodeStack[#self.nodeStack]
	local status = TestEnum.TestStatus.Success
	local skipped = true

	-- If all children were skipped, then we were skipped
	-- If any child failed, then we failed!
	for _, child in ipairs(last.children) do
		if child.status ~= TestEnum.TestStatus.Skipped then
			skipped = false

			if child.status == TestEnum.TestStatus.Failure then
				status = TestEnum.TestStatus.Failure
			end
		end
	end

	if skipped then
		status = TestEnum.TestStatus.Skipped
	end

	last.status = status
end

return TestSession
