1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768 |
- using System;
- using UnityEngine.Scripting;
- namespace UnityEngine.TestRunner
- {
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- [AttributeUsage(AttributeTargets.Assembly)]
- public class TestRunCallbackAttribute : Attribute
- {
- private Type m_Type;
-
-
-
-
-
- public TestRunCallbackAttribute(Type type)
- {
- var interfaceType = typeof(ITestRunCallback);
- if (!interfaceType.IsAssignableFrom(type))
- {
- throw new ArgumentException(string.Format(
- "Type {2} provided to {0} does not implement {1}. If the stripping level is set to high, the implementing class should have the {3}.",
- this.GetType().Name, interfaceType.Name, type.Name, typeof(PreserveAttribute).Name));
- }
- m_Type = type;
- }
- internal ITestRunCallback ConstructCallback()
- {
- return Activator.CreateInstance(m_Type) as ITestRunCallback;
- }
- }
- }
|