You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

68 lines
2.0 KiB
C#

1 year ago
using System;
using System.Collections.Generic;
using UnityEngine;
namespace UnityEditor.TestTools.CodeCoverage
{
[Serializable]
internal class CoverageEventDataImplementation
{
[SerializeField]
private SessionMode m_CoverageSessionMode;
[SerializeField]
private List<string> m_CoverageSessionResultPaths;
public void StartSession(SessionMode coverageSessionMode)
{
m_CoverageSessionMode = coverageSessionMode;
m_CoverageSessionResultPaths = new List<string>();
}
public void AddSessionResultPath(string path)
{
if (m_CoverageSessionResultPaths != null)
{
m_CoverageSessionResultPaths.Add(path);
}
}
public SessionMode CoverageSessionMode
{
get { return m_CoverageSessionMode; }
}
public List<string> CoverageSessionResultPaths
{
get { return m_CoverageSessionResultPaths; }
}
}
[Serializable]
internal class CoverageEventData : ScriptableSingleton<CoverageEventData>
{
[SerializeField]
private CoverageEventDataImplementation m_CoverageEventDataImplementation = null;
protected CoverageEventData() : base()
{
m_CoverageEventDataImplementation = new CoverageEventDataImplementation();
}
public void StartSession(SessionMode coverageSessionMode)
{
m_CoverageEventDataImplementation.StartSession(coverageSessionMode);
}
public void AddSessionResultPath(string path)
{
m_CoverageEventDataImplementation.AddSessionResultPath(path);
}
public SessionEventInfo GetCoverageSessionInfo()
{
SessionEventInfo info = new SessionEventInfo(m_CoverageEventDataImplementation.CoverageSessionMode, m_CoverageEventDataImplementation.CoverageSessionResultPaths);
return info;
}
}
}