Jelajahi Sumber

[unity][csharp] Moved automated tests out of the spine-unity Assets directory to a UPM package (to prevent potential compile errors upon incomplete setup). Updated spine-csharp tests to be usable as a UPM package.

Harald Csaszar 3 tahun lalu
induk
melakukan
3b061eaa5f
22 mengubah file dengan 187 tambahan dan 40 penghapusan
  1. 1 1
      spine-csharp/tests/assets.meta
  2. 1 1
      spine-csharp/tests/assets/test.json
  3. 7 0
      spine-csharp/tests/assets/test.json.meta
  4. 33 0
      spine-csharp/tests/package.json
  5. 7 0
      spine-csharp/tests/package.json.meta
  6. 4 0
      spine-csharp/tests/spine-csharp-tests.asmdef
  7. 7 0
      spine-csharp/tests/spine-csharp-tests.asmdef.meta
  8. 8 0
      spine-csharp/tests/src.meta
  9. 11 0
      spine-csharp/tests/src/AnimationStateTests.cs.meta
  10. 0 13
      spine-unity/Assets/SpineTests/SpineTests.asmdef
  11. 0 1
      spine-unity/Assets/SpineTests/spine-csharp-tests/add spine-csharp-tests here.txt
  12. 0 24
      spine-unity/Assets/SpineTests/src/RunAnimationStateTests.cs
  13. 0 0
      spine-unity/Modules/com.esotericsoftware.spine.spine-unity-tests/Tests.meta
  14. 38 0
      spine-unity/Modules/com.esotericsoftware.spine.spine-unity-tests/Tests/RunAnimationStateTests.cs
  15. 0 0
      spine-unity/Modules/com.esotericsoftware.spine.spine-unity-tests/Tests/RunAnimationStateTests.cs.meta
  16. 26 0
      spine-unity/Modules/com.esotericsoftware.spine.spine-unity-tests/Tests/spine-unity-tests.EditorTests.asmdef
  17. 0 0
      spine-unity/Modules/com.esotericsoftware.spine.spine-unity-tests/Tests/spine-unity-tests.EditorTests.asmdef.meta
  18. 36 0
      spine-unity/Modules/com.esotericsoftware.spine.spine-unity-tests/package.json
  19. 7 0
      spine-unity/Modules/com.esotericsoftware.spine.spine-unity-tests/package.json.meta
  20. 0 0
      spine-unity/Modules/com.esotericsoftware.spine.spine-unity-tests/spine-csharp-tests.meta
  21. 1 0
      spine-unity/Modules/com.esotericsoftware.spine.spine-unity-tests/spine-csharp-tests/add spine-csharp-tests here.txt
  22. 0 0
      spine-unity/Modules/com.esotericsoftware.spine.spine-unity-tests/spine-csharp-tests/add spine-csharp-tests here.txt.meta

+ 1 - 1
spine-unity/Assets/SpineTests.meta → spine-csharp/tests/assets.meta

@@ -1,5 +1,5 @@
 fileFormatVersion: 2
-guid: f5588a995395d7d428bb39ca0bfb7bd8
+guid: 1a1ea245fb673db4ba7bda20b0ed06e7
 folderAsset: yes
 DefaultImporter:
   externalObjects: {}

+ 1 - 1
spine-csharp/tests/assets/test.json

@@ -1,5 +1,5 @@
 {
-"skeleton": { "hash": "hj8P+t8L2OIWCj7RHV1Nzql4Y5E", "spine": "3.8.95", "images": "", "audio": "" },
+"skeleton": { "hash": "hj8P+t8L2OIWCj7RHV1Nzql4Y5E", "spine": "4.0.49", "images": "", "audio": "" },
 "bones": [
 	{ "name": "root" }
 ],

+ 7 - 0
spine-csharp/tests/assets/test.json.meta

@@ -0,0 +1,7 @@
+fileFormatVersion: 2
+guid: c75b8f7aac7429e4ea6031cf0903cea1
+TextScriptImporter:
+  externalObjects: {}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 33 - 0
spine-csharp/tests/package.json

@@ -0,0 +1,33 @@
+{
+	"name": "com.esotericsoftware.spine.spine-csharp-tests",
+	"displayName": "spine-csharp Runtime Tests",
+	"description": "This plugin provides tests for the spine-csharp core runtime.",
+	"version": "4.0.0",
+	"unity": "2018.3",
+	"author": {
+		"name": "Esoteric Software",
+		"email": "[email protected]",
+		"url": "http://esotericsoftware.com/"
+	},
+	"dependencies": {
+		"com.esotericsoftware.spine.spine-csharp": "4.0.0"
+	},
+	"repository": {
+		"type": "git",
+		"url": "[email protected]:EsotericSoftware/spine-runtimes.git"
+	},
+	"keywords": [
+		"spine",
+		"spine-csharp",
+		"runtimes",
+		"tests",
+		"2d",
+		"skeletal",
+		"animation"
+	],
+	"license": "SEE LICENSE IN LICENSE",
+	"bugs": {
+		"url": "https://github.com/EsotericSoftware/spine-runtimes/issues"
+	},
+	"homepage": "https://github.com/EsotericSoftware/spine-runtimes#readme"
+}

+ 7 - 0
spine-csharp/tests/package.json.meta

@@ -0,0 +1,7 @@
+fileFormatVersion: 2
+guid: 4b249db0e1f4b8d428a050fcc092099e
+PackageManifestImporter:
+  externalObjects: {}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 4 - 0
spine-csharp/tests/spine-csharp-tests.asmdef

@@ -0,0 +1,4 @@
+{
+	"name": "spine-csharp-tests",
+	"references": [ "spine-csharp" ]
+}

+ 7 - 0
spine-csharp/tests/spine-csharp-tests.asmdef.meta

@@ -0,0 +1,7 @@
+fileFormatVersion: 2
+guid: 55c3c2e44e0ce38458817aeb64482f91
+AssemblyDefinitionImporter:
+  externalObjects: {}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 8 - 0
spine-csharp/tests/src.meta

@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 65e2134dba09ce14b99b93184153067f
+folderAsset: yes
+DefaultImporter:
+  externalObjects: {}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 11 - 0
spine-csharp/tests/src/AnimationStateTests.cs.meta

@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 1ba84adcd3d667744bdac5d92c451668
+MonoImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 0 - 13
spine-unity/Assets/SpineTests/SpineTests.asmdef

@@ -1,13 +0,0 @@
-{
-    "name": "SpineTests",
-    "optionalUnityReferences": [
-        "TestAssemblies"
-    ],
-    "references" : [
-        "spine-unity",
-        "spine-csharp"
-    ],
-    "includePlatforms": [
-        "Editor"
-    ]
-}

+ 0 - 1
spine-unity/Assets/SpineTests/spine-csharp-tests/add spine-csharp-tests here.txt

@@ -1 +0,0 @@
-Add the directory content of 'spine-csharp/tests' as 'tests' here (e.g. using a symlink).

+ 0 - 24
spine-unity/Assets/SpineTests/src/RunAnimationStateTests.cs

@@ -1,24 +0,0 @@
-using NUnit.Framework;
-using System.Collections;
-using System.Collections.Generic;
-using UnityEngine;
-using UnityEngine.TestTools;
-
-namespace Spine.Unity.Tests {
-	public class RunAnimationStateTests {
-		[Test]
-		public void RunAnimationStateTestsSimplePasses () {
-			AnimationStateTests.logImplementation += Log;
-			AnimationStateTests.failImplementation += Fail;
-			AnimationStateTests.Main("Assets/SpineTests/spine-csharp-tests/tests/assets/test.json");
-		}
-
-		public void Log (string message) {
-			UnityEngine.Debug.Log(message);
-		}
-
-		public void Fail (string message) {
-			Assert.Fail(message);
-		}
-	}
-}

+ 0 - 0
spine-unity/Assets/SpineTests/src.meta → spine-unity/Modules/com.esotericsoftware.spine.spine-unity-tests/Tests.meta


+ 38 - 0
spine-unity/Modules/com.esotericsoftware.spine.spine-unity-tests/Tests/RunAnimationStateTests.cs

@@ -0,0 +1,38 @@
+using NUnit.Framework;
+using System.Collections;
+using System.Collections.Generic;
+using UnityEngine;
+using UnityEngine.TestTools;
+
+namespace Spine.Unity.Tests {
+	public class RunAnimationStateTests {
+		[Test]
+		public void RunAnimationStateTestsSimplePasses () {
+			AnimationStateTests.logImplementation += Log;
+			AnimationStateTests.failImplementation += Fail;
+			//AnimationStateTests.Main("Assets/SpineTests/spine-csharp-tests/tests/assets/test.json");
+
+			string testJsonFilename = "test";
+			string testJsonPathEnd = "tests/assets/" + testJsonFilename + ".json";
+			var guids = UnityEditor.AssetDatabase.FindAssets(testJsonFilename + " t:textasset");
+			if (guids.Length <= 0) Fail(testJsonFilename + ".json asset not found.");
+
+			foreach (var guid in guids) {
+				string assetPath = UnityEditor.AssetDatabase.GUIDToAssetPath(guid);
+				if (assetPath.EndsWith(testJsonPathEnd)) {
+					AnimationStateTests.Main(assetPath);
+					return;
+				}
+			}
+			Fail(testJsonPathEnd + " not found.");
+		}
+
+		public void Log (string message) {
+			UnityEngine.Debug.Log(message);
+		}
+
+		public void Fail (string message) {
+			Assert.Fail(message);
+		}
+	}
+}

+ 0 - 0
spine-unity/Assets/SpineTests/src/RunAnimationStateTests.cs.meta → spine-unity/Modules/com.esotericsoftware.spine.spine-unity-tests/Tests/RunAnimationStateTests.cs.meta


+ 26 - 0
spine-unity/Modules/com.esotericsoftware.spine.spine-unity-tests/Tests/spine-unity-tests.EditorTests.asmdef

@@ -0,0 +1,26 @@
+{
+    "name": "spine-unity-tests.Editor.Tests",
+    "rootNamespace": "",
+    "references": [
+        "spine-unity",
+        "spine-csharp",
+        "spine-csharp-tests",
+        "UnityEngine.TestRunner",
+        "UnityEditor.TestRunner"
+    ],
+    "includePlatforms": [
+        "Editor"
+    ],
+    "excludePlatforms": [],
+    "allowUnsafeCode": false,
+    "overrideReferences": true,
+    "precompiledReferences": [
+        "nunit.framework.dll"
+    ],
+    "autoReferenced": false,
+    "defineConstraints": [
+        "UNITY_INCLUDE_TESTS"
+    ],
+    "versionDefines": [],
+    "noEngineReferences": false
+}

+ 0 - 0
spine-unity/Assets/SpineTests/SpineTests.asmdef.meta → spine-unity/Modules/com.esotericsoftware.spine.spine-unity-tests/Tests/spine-unity-tests.EditorTests.asmdef.meta


+ 36 - 0
spine-unity/Modules/com.esotericsoftware.spine.spine-unity-tests/package.json

@@ -0,0 +1,36 @@
+{
+  "name": "com.esotericsoftware.spine.spine-unity-tests",
+  "displayName": "spine-unity Runtime Tests",
+  "description": "This plugin provides tests for the spine-unity runtime.",
+  "version": "4.0.0",
+  "unity": "2018.3",
+  "author": {
+    "name": "Esoteric Software",
+    "email": "[email protected]",
+    "url": "http://esotericsoftware.com/"
+  },
+  "dependencies": {
+    "com.esotericsoftware.spine.spine-csharp-tests": "4.0.0",
+    "com.esotericsoftware.spine.spine-csharp": "4.0.0",
+    "com.esotericsoftware.spine.spine-unity": "4.0.0"
+  },
+  "repository": {
+    "type": "git",
+    "url": "[email protected]:EsotericSoftware/spine-runtimes.git"
+  },
+  "keywords": [
+    "spine",
+    "spine-unity",
+    "runtimes",
+    "tests",
+    "2d",
+    "skeletal",
+    "animation"
+  ],
+  "license": "SEE LICENSE IN LICENSE",
+  "bugs": {
+    "url": "https://github.com/EsotericSoftware/spine-runtimes/issues"
+  },
+  "homepage": "https://github.com/EsotericSoftware/spine-runtimes#readme",
+  "type": "tests"
+}

+ 7 - 0
spine-unity/Modules/com.esotericsoftware.spine.spine-unity-tests/package.json.meta

@@ -0,0 +1,7 @@
+fileFormatVersion: 2
+guid: 11052e5422ef2be4eae7b875ba449c31
+PackageManifestImporter:
+  externalObjects: {}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 0 - 0
spine-unity/Assets/SpineTests/spine-csharp-tests.meta → spine-unity/Modules/com.esotericsoftware.spine.spine-unity-tests/spine-csharp-tests.meta


+ 1 - 0
spine-unity/Modules/com.esotericsoftware.spine.spine-unity-tests/spine-csharp-tests/add spine-csharp-tests here.txt

@@ -0,0 +1 @@
+Add the directory content of 'spine-csharp/tests' as 'tests' here (e.g. using a symlink), or import the package via the `package.json` file located in `spine-csharp/tests`.

+ 0 - 0
spine-unity/Assets/SpineTests/spine-csharp-tests/add spine-csharp-tests here.txt.meta → spine-unity/Modules/com.esotericsoftware.spine.spine-unity-tests/spine-csharp-tests/add spine-csharp-tests here.txt.meta