Commit af571a61 authored by BlackAngle233's avatar BlackAngle233
Browse files

212

parent 1d9b5391
using System;
using System.Collections.Generic;
using System.Linq;
using NUnit.Framework.Interfaces;
using NUnit.Framework.Internal;
using NUnit.Framework.Internal.Filters;
using UnityEngine;
using UnityEngine.TestRunner.NUnitExtensions.Filters;
using UnityEngine.TestTools.TestRunner.GUI;
namespace UnityEditor.TestTools.TestRunner.Api
{
[Serializable]
public class Filter
{
[SerializeField]
public TestMode testMode;
[SerializeField]
public string[] testNames;
[SerializeField]
public string[] groupNames;
[SerializeField]
public string[] categoryNames;
[SerializeField]
public string[] assemblyNames;
[SerializeField]
public BuildTarget? targetPlatform;
internal TestRunnerFilter ToTestRunnerFilter()
{
return new TestRunnerFilter()
{
testNames = testNames,
categoryNames = categoryNames,
groupNames = groupNames,
assemblyNames = assemblyNames
};
}
internal ITestFilter BuildNUnitFilter(bool synchronousOnly)
{
var filters = new List<ITestFilter>();
if (testNames != null && testNames.Length != 0)
{
var nameFilter = new OrFilter(testNames.Select(n => new FullNameFilter(n)).ToArray());
filters.Add(nameFilter);
}
if (groupNames != null && groupNames.Length != 0)
{
var exactNamesFilter = new OrFilter(groupNames.Select(n =>
{
var f = new FullNameFilter(n);
f.IsRegex = true;
return f;
}).ToArray());
filters.Add(exactNamesFilter);
}
if (assemblyNames != null && assemblyNames.Length != 0)
{
var assemblyFilter = new OrFilter(assemblyNames.Select(c => new AssemblyNameFilter(c)).ToArray());
filters.Add(assemblyFilter);
}
if (categoryNames != null && categoryNames.Length != 0)
{
var categoryFilter = new OrFilter(categoryNames.Select(c => new CategoryFilterExtended(c) {IsRegex = true}).ToArray());
filters.Add(categoryFilter);
}
if (synchronousOnly)
{
filters.Add(new SynchronousFilter());
}
return filters.Count == 0 ? TestFilter.Empty : new AndFilter(filters.ToArray());
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using NUnit.Framework.Interfaces;
using NUnit.Framework.Internal;
using NUnit.Framework.Internal.Filters;
using UnityEngine;
using UnityEngine.TestRunner.NUnitExtensions.Filters;
using UnityEngine.TestTools.TestRunner.GUI;
namespace UnityEditor.TestTools.TestRunner.Api
{
[Serializable]
public class Filter
{
[SerializeField]
public TestMode testMode;
[SerializeField]
public string[] testNames;
[SerializeField]
public string[] groupNames;
[SerializeField]
public string[] categoryNames;
[SerializeField]
public string[] assemblyNames;
[SerializeField]
public BuildTarget? targetPlatform;
internal TestRunnerFilter ToTestRunnerFilter()
{
return new TestRunnerFilter()
{
testNames = testNames,
categoryNames = categoryNames,
groupNames = groupNames,
assemblyNames = assemblyNames
};
}
internal ITestFilter BuildNUnitFilter(bool synchronousOnly)
{
var filters = new List<ITestFilter>();
if (testNames != null && testNames.Length != 0)
{
var nameFilter = new OrFilter(testNames.Select(n => new FullNameFilter(n)).ToArray());
filters.Add(nameFilter);
}
if (groupNames != null && groupNames.Length != 0)
{
var exactNamesFilter = new OrFilter(groupNames.Select(n =>
{
var f = new FullNameFilter(n);
f.IsRegex = true;
return f;
}).ToArray());
filters.Add(exactNamesFilter);
}
if (assemblyNames != null && assemblyNames.Length != 0)
{
var assemblyFilter = new OrFilter(assemblyNames.Select(c => new AssemblyNameFilter(c)).ToArray());
filters.Add(assemblyFilter);
}
if (categoryNames != null && categoryNames.Length != 0)
{
var categoryFilter = new OrFilter(categoryNames.Select(c => new CategoryFilterExtended(c) {IsRegex = true}).ToArray());
filters.Add(categoryFilter);
}
if (synchronousOnly)
{
filters.Add(new SynchronousFilter());
}
return filters.Count == 0 ? TestFilter.Empty : new AndFilter(filters.ToArray());
}
}
}
fileFormatVersion: 2
guid: 05f92e4a2414cb144a92157752dfa324
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 05f92e4a2414cb144a92157752dfa324
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
namespace UnityEditor.TestTools.TestRunner.Api
{
public interface ICallbacks
{
void RunStarted(ITestAdaptor testsToRun);
void RunFinished(ITestResultAdaptor result);
void TestStarted(ITestAdaptor test);
void TestFinished(ITestResultAdaptor result);
}
}
namespace UnityEditor.TestTools.TestRunner.Api
{
public interface ICallbacks
{
void RunStarted(ITestAdaptor testsToRun);
void RunFinished(ITestResultAdaptor result);
void TestStarted(ITestAdaptor test);
void TestFinished(ITestResultAdaptor result);
}
}
fileFormatVersion: 2
guid: 93eea84e53d0226479c9a584f19427b5
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 93eea84e53d0226479c9a584f19427b5
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
using NUnit.Framework.Interfaces;
namespace UnityEditor.TestTools.TestRunner.Api
{
internal interface ICallbacksDelegator
{
void RunStarted(ITest testsToRun);
void RunStartedRemotely(byte[] testsToRunData);
void RunFinished(ITestResult testResults);
void RunFinishedRemotely(byte[] testResultsData);
void RunFailed(string failureMessage);
void TestStarted(ITest test);
void TestStartedRemotely(byte[] testStartedData);
void TestFinished(ITestResult result);
void TestFinishedRemotely(byte[] testResultsData);
void TestTreeRebuild(ITest test);
}
using NUnit.Framework.Interfaces;
namespace UnityEditor.TestTools.TestRunner.Api
{
internal interface ICallbacksDelegator
{
void RunStarted(ITest testsToRun);
void RunStartedRemotely(byte[] testsToRunData);
void RunFinished(ITestResult testResults);
void RunFinishedRemotely(byte[] testResultsData);
void RunFailed(string failureMessage);
void TestStarted(ITest test);
void TestStartedRemotely(byte[] testStartedData);
void TestFinished(ITestResult result);
void TestFinishedRemotely(byte[] testResultsData);
void TestTreeRebuild(ITest test);
}
}
\ No newline at end of file
fileFormatVersion: 2
guid: 8f8f74fe8e363da42875d9cab025d3b2
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 8f8f74fe8e363da42875d9cab025d3b2
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
namespace UnityEditor.TestTools.TestRunner.Api
{
internal interface ICallbacksHolder
{
void Add(ICallbacks callback, int priority);
void Remove(ICallbacks callback);
ICallbacks[] GetAll();
void Clear();
}
namespace UnityEditor.TestTools.TestRunner.Api
{
internal interface ICallbacksHolder
{
void Add(ICallbacks callback, int priority);
void Remove(ICallbacks callback);
ICallbacks[] GetAll();
void Clear();
}
}
\ No newline at end of file
fileFormatVersion: 2
guid: d742f2caefd9f934d9f19dad07a08e6f
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: d742f2caefd9f934d9f19dad07a08e6f
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
namespace UnityEditor.TestTools.TestRunner.Api
{
public interface IErrorCallbacks : ICallbacks
{
void OnError(string message);
}
}
namespace UnityEditor.TestTools.TestRunner.Api
{
public interface IErrorCallbacks : ICallbacks
{
void OnError(string message);
}
}
fileFormatVersion: 2
guid: 1a06c562b0c5eb046bcb876a29f93c98
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 1a06c562b0c5eb046bcb876a29f93c98
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
using System.Collections.Generic;
using NUnit.Framework.Interfaces;
namespace UnityEditor.TestTools.TestRunner.Api
{
public interface ITestAdaptor
{
string Id { get; }
string Name { get; }
string FullName { get; }
int TestCaseCount { get; }
bool HasChildren { get; }
bool IsSuite { get; }
IEnumerable<ITestAdaptor> Children { get; }
ITestAdaptor Parent { get; }
int TestCaseTimeout { get; }
ITypeInfo TypeInfo { get; }
IMethodInfo Method { get; }
string[] Categories { get; }
bool IsTestAssembly { get; }
RunState RunState { get; }
string Description { get; }
string SkipReason { get; }
string ParentId { get; }
string ParentFullName { get; }
string UniqueName { get; }
string ParentUniqueName { get; }
int ChildIndex { get; }
TestMode TestMode { get; }
}
}
using System.Collections.Generic;
using NUnit.Framework.Interfaces;
namespace UnityEditor.TestTools.TestRunner.Api
{
public interface ITestAdaptor
{
string Id { get; }
string Name { get; }
string FullName { get; }
int TestCaseCount { get; }
bool HasChildren { get; }
bool IsSuite { get; }
IEnumerable<ITestAdaptor> Children { get; }
ITestAdaptor Parent { get; }
int TestCaseTimeout { get; }
ITypeInfo TypeInfo { get; }
IMethodInfo Method { get; }
string[] Categories { get; }
bool IsTestAssembly { get; }
RunState RunState { get; }
string Description { get; }
string SkipReason { get; }
string ParentId { get; }
string ParentFullName { get; }
string UniqueName { get; }
string ParentUniqueName { get; }
int ChildIndex { get; }
TestMode TestMode { get; }
}
}
fileFormatVersion: 2
guid: 85dd7af03f02aea4aae13a3945e3b313
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 85dd7af03f02aea4aae13a3945e3b313
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
using System.Collections.Generic;
using NUnit.Framework.Interfaces;
using UnityEngine.TestRunner.TestLaunchers;
namespace UnityEditor.TestTools.TestRunner.Api
{
internal interface ITestAdaptorFactory
{
ITestAdaptor Create(ITest test);
ITestAdaptor Create(RemoteTestData testData);
ITestResultAdaptor Create(ITestResult testResult);
ITestResultAdaptor Create(RemoteTestResultData testResult, RemoteTestResultDataWithTestData allData);
ITestAdaptor BuildTree(RemoteTestResultDataWithTestData data);
IEnumerator<ITestAdaptor> BuildTreeAsync(RemoteTestResultDataWithTestData data);
void ClearResultsCache();
void ClearTestsCache();
}
}
using System.Collections.Generic;
using NUnit.Framework.Interfaces;
using UnityEngine.TestRunner.TestLaunchers;
namespace UnityEditor.TestTools.TestRunner.Api
{
internal interface ITestAdaptorFactory
{
ITestAdaptor Create(ITest test);
ITestAdaptor Create(RemoteTestData testData);
ITestResultAdaptor Create(ITestResult testResult);
ITestResultAdaptor Create(RemoteTestResultData testResult, RemoteTestResultDataWithTestData allData);
ITestAdaptor BuildTree(RemoteTestResultDataWithTestData data);
IEnumerator<ITestAdaptor> BuildTreeAsync(RemoteTestResultDataWithTestData data);
void ClearResultsCache();
void ClearTestsCache();
}
}
fileFormatVersion: 2
guid: 803abab0f7e17044db56f8760186dbd1
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 803abab0f7e17044db56f8760186dbd1
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
using System;
using System.Collections.Generic;
using NUnit.Framework.Interfaces;
namespace UnityEditor.TestTools.TestRunner.Api
{
public interface ITestResultAdaptor
{
ITestAdaptor Test { get; }
string Name { get; }
/// <summary>Gets the full name of the test result</summary>
string FullName { get; }
string ResultState { get; }
TestStatus TestStatus { get; }
/// <summary>Gets the elapsed time for running the test in seconds</summary>
double Duration { get; }
/// <summary>Gets or sets the time the test started running.</summary>
DateTime StartTime { get; }
/// <summary>Gets or sets the time the test finished running.</summary>
DateTime EndTime { get; }
/// <summary>
/// Gets the message associated with a test
/// failure or with not running the test
/// </summary>
string Message { get; }
/// <summary>
/// Gets any stacktrace associated with an
/// error or failure. Not available in
/// the Compact Framework 1.0.
/// </summary>
string StackTrace { get; }
/// <summary>
/// Gets the number of asserts executed
/// when running the test and all its children.
/// </summary>
int AssertCount { get; }
/// <summary>
/// Gets the number of test cases that failed
/// when running the test and all its children.
/// </summary>
int FailCount { get; }
/// <summary>
/// Gets the number of test cases that passed
/// when running the test and all its children.
/// </summary>
int PassCount { get; }
/// <summary>
/// Gets the number of test cases that were skipped
/// when running the test and all its children.
/// </summary>
int SkipCount { get; }
/// <summary>
/// Gets the number of test cases that were inconclusive
/// when running the test and all its children.
/// </summary>
int InconclusiveCount { get; }
/// <summary>
/// Indicates whether this result has any child results.
/// Accessing HasChildren should not force creation of the
/// Children collection in classes implementing this interface.
/// </summary>
bool HasChildren { get; }
/// <summary>Gets the the collection of child results.</summary>
IEnumerable<ITestResultAdaptor> Children { get; }
/// <summary>Gets any text output written to this result.</summary>
string Output { get; }
TNode ToXml();
}
}
using System;
using System.Collections.Generic;
using NUnit.Framework.Interfaces;
namespace UnityEditor.TestTools.TestRunner.Api
{
public interface ITestResultAdaptor
{
ITestAdaptor Test { get; }
string Name { get; }
/// <summary>Gets the full name of the test result</summary>
string FullName { get; }
string ResultState { get; }
TestStatus TestStatus { get; }
/// <summary>Gets the elapsed time for running the test in seconds</summary>
double Duration { get; }
/// <summary>Gets or sets the time the test started running.</summary>
DateTime StartTime { get; }
/// <summary>Gets or sets the time the test finished running.</summary>
DateTime EndTime { get; }
/// <summary>
/// Gets the message associated with a test
/// failure or with not running the test
/// </summary>
string Message { get; }
/// <summary>
/// Gets any stacktrace associated with an
/// error or failure. Not available in
/// the Compact Framework 1.0.
/// </summary>
string StackTrace { get; }
/// <summary>
/// Gets the number of asserts executed
/// when running the test and all its children.
/// </summary>
int AssertCount { get; }
/// <summary>
/// Gets the number of test cases that failed
/// when running the test and all its children.
/// </summary>
int FailCount { get; }
/// <summary>
/// Gets the number of test cases that passed
/// when running the test and all its children.
/// </summary>
int PassCount { get; }
/// <summary>
/// Gets the number of test cases that were skipped
/// when running the test and all its children.
/// </summary>
int SkipCount { get; }
/// <summary>
/// Gets the number of test cases that were inconclusive
/// when running the test and all its children.
/// </summary>
int InconclusiveCount { get; }
/// <summary>
/// Indicates whether this result has any child results.
/// Accessing HasChildren should not force creation of the
/// Children collection in classes implementing this interface.
/// </summary>
bool HasChildren { get; }
/// <summary>Gets the the collection of child results.</summary>
IEnumerable<ITestResultAdaptor> Children { get; }
/// <summary>Gets any text output written to this result.</summary>
string Output { get; }
TNode ToXml();
}
}
fileFormatVersion: 2
guid: 4f90cfe4bf5cfb44f84a5b11387f2a42
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 4f90cfe4bf5cfb44f84a5b11387f2a42
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
using System;
namespace UnityEditor.TestTools.TestRunner.Api
{
public interface ITestRunSettings : IDisposable
{
void Apply();
}
}
using System;
namespace UnityEditor.TestTools.TestRunner.Api
{
public interface ITestRunSettings : IDisposable
{
void Apply();
}
}
fileFormatVersion: 2
guid: 2ae2ce6274819484fa8747a28cebdf3a
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 2ae2ce6274819484fa8747a28cebdf3a
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
using System;
namespace UnityEditor.TestTools.TestRunner.Api
{
internal interface ITestRunnerApi
{
string Execute(ExecutionSettings executionSettings);
void RegisterCallbacks<T>(T testCallbacks, int priority = 0) where T : ICallbacks;
void UnregisterCallbacks<T>(T testCallbacks) where T : ICallbacks;
void RetrieveTestList(TestMode testMode, Action<ITestAdaptor> callback);
}
}
using System;
namespace UnityEditor.TestTools.TestRunner.Api
{
internal interface ITestRunnerApi
{
string Execute(ExecutionSettings executionSettings);
void RegisterCallbacks<T>(T testCallbacks, int priority = 0) where T : ICallbacks;
void UnregisterCallbacks<T>(T testCallbacks) where T : ICallbacks;
void RetrieveTestList(TestMode testMode, Action<ITestAdaptor> callback);
}
}
fileFormatVersion: 2
guid: a7842a837a4b13e41ae16193db753418
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: a7842a837a4b13e41ae16193db753418
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment