Browse Source

Updated Unity Test Tools

master
chrisgregan 9 years ago
parent
commit
9e76e9635c
  1. 2
      Assets/UnityTestTools.meta
  2. 2
      Assets/UnityTestTools/Common/Settings.meta
  3. 2
      Assets/UnityTestTools/Common/Settings/IntegrationTestsRunnerSettings.asset.meta
  4. 2
      Assets/UnityTestTools/IntegrationTestsFramework/Libs.meta
  5. 6
      Assets/UnityTestTools/IntegrationTestsFramework/Libs/Mono.Cecil.Mdb.dll.meta
  6. 6
      Assets/UnityTestTools/IntegrationTestsFramework/Libs/Mono.Cecil.dll.meta
  7. 15
      Assets/UnityTestTools/IntegrationTestsFramework/TestRunner/Editor/Batch.cs
  8. 2
      Assets/UnityTestTools/IntegrationTestsFramework/TestRunner/Editor/EditorReferencesUtil.cs.meta
  9. 4
      Assets/UnityTestTools/IntegrationTestsFramework/TestRunner/Editor/PlatformRunner/PlatformRunnerSettingsWindow.cs
  10. 11
      Assets/UnityTestTools/IntegrationTestsFramework/TestRunner/TestRunner.cs
  11. 31
      Assets/UnityTestTools/IntegrationTestsFramework/TestRunner/TestRunnerConfigurator.cs
  12. 16
      Assets/UnityTestTools/changelog.txt

2
Assets/UnityTestTools.meta

@ -1,7 +1,7 @@
fileFormatVersion: 2 fileFormatVersion: 2
guid: 5c8e5d66ff19140a1bf3cfdc3955859c guid: 5c8e5d66ff19140a1bf3cfdc3955859c
folderAsset: yes folderAsset: yes
timeCreated: 1450715827 timeCreated: 1458650910
licenseType: Free licenseType: Free
DefaultImporter: DefaultImporter:
userData: userData:

2
Assets/UnityTestTools/Common/Settings.meta

@ -1,7 +1,7 @@
fileFormatVersion: 2 fileFormatVersion: 2
guid: 4f7795beea73b4d50bd536d0012e8e85 guid: 4f7795beea73b4d50bd536d0012e8e85
folderAsset: yes folderAsset: yes
timeCreated: 1450715835 timeCreated: 1458650919
licenseType: Free licenseType: Free
DefaultImporter: DefaultImporter:
userData: userData:

2
Assets/UnityTestTools/Common/Settings/IntegrationTestsRunnerSettings.asset.meta

@ -1,6 +1,6 @@
fileFormatVersion: 2 fileFormatVersion: 2
guid: ec24e4a07acd24ffaa1cd1df7fa11d54 guid: ec24e4a07acd24ffaa1cd1df7fa11d54
timeCreated: 1455275624 timeCreated: 1458650919
licenseType: Free licenseType: Free
NativeFormatImporter: NativeFormatImporter:
userData: userData:

2
Assets/UnityTestTools/IntegrationTestsFramework/Libs.meta

@ -2,7 +2,7 @@ fileFormatVersion: 2
guid: e22ba039de7077c4aa95758ef723b803 guid: e22ba039de7077c4aa95758ef723b803
folderAsset: yes folderAsset: yes
timeCreated: 1445282049 timeCreated: 1445282049
licenseType: Pro licenseType: Store
DefaultImporter: DefaultImporter:
userData: userData:
assetBundleName: assetBundleName:

6
Assets/UnityTestTools/IntegrationTestsFramework/Libs/Mono.Cecil.Mdb.dll.meta

@ -1,7 +1,7 @@
fileFormatVersion: 2 fileFormatVersion: 2
guid: 713231d47408a06408a45470c967bae8 guid: 713231d47408a06408a45470c967bae8
timeCreated: 1441797177 timeCreated: 1441797177
licenseType: Pro licenseType: Store
PluginImporter: PluginImporter:
serializedVersion: 1 serializedVersion: 1
iconMap: {} iconMap: {}
@ -15,10 +15,6 @@ PluginImporter:
enabled: 1 enabled: 1
settings: settings:
DefaultValueInitialized: true DefaultValueInitialized: true
WindowsStoreApps:
enabled: 0
settings:
CPU: AnyCPU
userData: userData:
assetBundleName: assetBundleName:
assetBundleVariant: assetBundleVariant:

6
Assets/UnityTestTools/IntegrationTestsFramework/Libs/Mono.Cecil.dll.meta

@ -1,7 +1,7 @@
fileFormatVersion: 2 fileFormatVersion: 2
guid: 28fc22990733f8f4ea1137f15e363609 guid: 28fc22990733f8f4ea1137f15e363609
timeCreated: 1441797177 timeCreated: 1441797177
licenseType: Pro licenseType: Store
PluginImporter: PluginImporter:
serializedVersion: 1 serializedVersion: 1
iconMap: {} iconMap: {}
@ -15,10 +15,6 @@ PluginImporter:
enabled: 1 enabled: 1
settings: settings:
DefaultValueInitialized: true DefaultValueInitialized: true
WindowsStoreApps:
enabled: 0
settings:
CPU: AnyCPU
userData: userData:
assetBundleName: assetBundleName:
assetBundleVariant: assetBundleVariant:

15
Assets/UnityTestTools/IntegrationTestsFramework/TestRunner/Editor/Batch.cs

@ -89,6 +89,15 @@ namespace UnityTest
EditorApplication.Exit(returnCodeRunError); EditorApplication.Exit(returnCodeRunError);
return; return;
} }
string previousScenesXml = "";
var serializer = new System.Xml.Serialization.XmlSerializer(typeof(EditorBuildSettingsScene[]));
using(StringWriter textWriter = new StringWriter())
{
serializer.Serialize(textWriter, EditorBuildSettings.scenes);
previousScenesXml = textWriter.ToString();
}
EditorBuildSettings.scenes = (testScenes.Concat(otherBuildScenes).ToList()).Select(s => new EditorBuildSettingsScene(s, true)).ToArray(); EditorBuildSettings.scenes = (testScenes.Concat(otherBuildScenes).ToList()).Select(s => new EditorBuildSettingsScene(s, true)).ToArray();
EditorSceneManager.OpenScene(testScenes.First()); EditorSceneManager.OpenScene(testScenes.First());
GuiHelper.SetConsoleErrorPause(false); GuiHelper.SetConsoleErrorPause(false);
@ -100,10 +109,12 @@ namespace UnityTest
port = PlatformRunnerConfiguration.TryToGetFreePort(), port = PlatformRunnerConfiguration.TryToGetFreePort(),
runInEditor = true runInEditor = true
}; };
var settings = new PlayerSettingConfigurator(true); var settings = new PlayerSettingConfigurator(true);
settings.AddConfigurationFile(TestRunnerConfigurator.integrationTestsNetwork, string.Join("\n", config.GetConnectionIPs())); settings.AddConfigurationFile(TestRunnerConfigurator.integrationTestsNetwork, string.Join("\n", config.GetConnectionIPs()));
settings.AddConfigurationFile(TestRunnerConfigurator.testScenesToRun, string.Join ("\n", testScenes.ToArray()));
settings.AddConfigurationFile(TestRunnerConfigurator.previousScenes, previousScenesXml);
NetworkResultsReceiver.StartReceiver(config); NetworkResultsReceiver.StartReceiver(config);
EditorApplication.isPlaying = true; EditorApplication.isPlaying = true;

2
Assets/UnityTestTools/IntegrationTestsFramework/TestRunner/Editor/EditorReferencesUtil.cs.meta

@ -1,7 +1,7 @@
fileFormatVersion: 2 fileFormatVersion: 2
guid: aad501c968b324cf3a8d1c52eb09ca04 guid: aad501c968b324cf3a8d1c52eb09ca04
timeCreated: 1437322927 timeCreated: 1437322927
licenseType: Pro licenseType: Store
MonoImporter: MonoImporter:
serializedVersion: 2 serializedVersion: 2
defaultReferences: [] defaultReferences: []

4
Assets/UnityTestTools/IntegrationTestsFramework/TestRunner/Editor/PlatformRunner/PlatformRunnerSettingsWindow.cs

@ -248,8 +248,10 @@ namespace UnityTest.IntegrationTests
else if (m_Settings.port < IPEndPoint.MinPort) else if (m_Settings.port < IPEndPoint.MinPort)
m_Settings.port = IPEndPoint.MinPort; m_Settings.port = IPEndPoint.MinPort;
} }
EditorGUI.EndDisabledGroup();
} }
EditorGUI.EndDisabledGroup();
if (EditorGUI.EndChangeCheck()) if (EditorGUI.EndChangeCheck())
{ {
m_Settings.Save(); m_Settings.Save();

11
Assets/UnityTestTools/IntegrationTestsFramework/TestRunner/TestRunner.cs

@ -307,7 +307,7 @@ namespace UnityTest
TestSceneNumber += 1; TestSceneNumber += 1;
string testScene = m_Configurator.GetIntegrationTestScenes (TestSceneNumber); string testScene = m_Configurator.GetIntegrationTestScenes(TestSceneNumber);
if (testScene != null) if (testScene != null)
SceneManager.LoadScene(Path.GetFileNameWithoutExtension(testScene)); SceneManager.LoadScene(Path.GetFileNameWithoutExtension(testScene));
@ -315,6 +315,15 @@ namespace UnityTest
{ {
TestRunnerCallback.AllScenesFinished(); TestRunnerCallback.AllScenesFinished();
k_ResultRenderer.ShowResults(); k_ResultRenderer.ShowResults();
#if UNITY_EDITOR
var prevScenes = m_Configurator.GetPreviousScenesToRestore();
if(prevScenes!=null)
{
UnityEditor.EditorBuildSettings.scenes = prevScenes;
}
#endif
if (m_Configurator.isBatchRun && m_Configurator.sendResultsOverNetwork) if (m_Configurator.isBatchRun && m_Configurator.sendResultsOverNetwork)
Application.Quit(); Application.Quit();
} }

31
Assets/UnityTestTools/IntegrationTestsFramework/TestRunner/TestRunnerConfigurator.cs

@ -25,6 +25,7 @@ namespace UnityTest
public static string integrationTestsNetwork = "networkconfig.txt"; public static string integrationTestsNetwork = "networkconfig.txt";
public static string batchRunFileMarker = "batchrun.txt"; public static string batchRunFileMarker = "batchrun.txt";
public static string testScenesToRun = "testscenes.txt"; public static string testScenesToRun = "testscenes.txt";
public static string previousScenes = "previousScenes.txt";
public bool isBatchRun { get; private set; } public bool isBatchRun { get; private set; }
@ -40,6 +41,36 @@ namespace UnityTest
CheckForSendingResultsOverNetwork(); CheckForSendingResultsOverNetwork();
} }
#if UNITY_EDITOR
public UnityEditor.EditorBuildSettingsScene[] GetPreviousScenesToRestore()
{
string text = null;
if (Application.isEditor)
{
text = GetTextFromTempFile(previousScenes);
}
if(text != null)
{
var serializer = new System.Xml.Serialization.XmlSerializer(typeof(UnityEditor.EditorBuildSettingsScene[]));
using(var textReader = new StringReader(text))
{
try
{
return (UnityEditor.EditorBuildSettingsScene[] )serializer.Deserialize(textReader);
}
catch (System.Xml.XmlException e)
{
Debug.Log(e);
return null;
}
}
}
return null;
}
#endif
public string GetIntegrationTestScenes(int testSceneNum) public string GetIntegrationTestScenes(int testSceneNum)
{ {
string text; string text;

16
Assets/UnityTestTools/changelog.txt

@ -1,7 +1,11 @@
Version 1.5.8
- Bugfixes
Version 1.5.7 Version 1.5.7
- Updated tools for Unity 5.3 - Updated tools for Unity 5.3
Version 1.5.6 Version 1.5.6
- Updated Mono.Cecil.dll and Mono.Cecil.Mdb.dll libraries - Updated Mono.Cecil.dll and Mono.Cecil.Mdb.dll libraries
@ -14,12 +18,12 @@ Version 1.5.5
Version 1.5.4 Version 1.5.4
- APIs updates - APIs updates
Version 1.5.3 Version 1.5.3
- Bug fixes - Bug fixes
Version 1.5.2 Version 1.5.2
- Bug fixes - Bug fixes

Loading…
Cancel
Save