mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2025-12-20 17:26:01 +08:00
[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.
This commit is contained in:
parent
506a1abf53
commit
3b061eaa5f
@ -1,5 +1,5 @@
|
|||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: f5588a995395d7d428bb39ca0bfb7bd8
|
guid: 1a1ea245fb673db4ba7bda20b0ed06e7
|
||||||
folderAsset: yes
|
folderAsset: yes
|
||||||
DefaultImporter:
|
DefaultImporter:
|
||||||
externalObjects: {}
|
externalObjects: {}
|
||||||
@ -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": [
|
"bones": [
|
||||||
{ "name": "root" }
|
{ "name": "root" }
|
||||||
],
|
],
|
||||||
|
|||||||
7
spine-csharp/tests/assets/test.json.meta
Normal file
7
spine-csharp/tests/assets/test.json.meta
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: c75b8f7aac7429e4ea6031cf0903cea1
|
||||||
|
TextScriptImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
33
spine-csharp/tests/package.json
Normal file
33
spine-csharp/tests/package.json
Normal file
@ -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": "contact@esotericsoftware.com",
|
||||||
|
"url": "http://esotericsoftware.com/"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"com.esotericsoftware.spine.spine-csharp": "4.0.0"
|
||||||
|
},
|
||||||
|
"repository": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "git@github.com: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
spine-csharp/tests/package.json.meta
Normal file
7
spine-csharp/tests/package.json.meta
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 4b249db0e1f4b8d428a050fcc092099e
|
||||||
|
PackageManifestImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
4
spine-csharp/tests/spine-csharp-tests.asmdef
Normal file
4
spine-csharp/tests/spine-csharp-tests.asmdef
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
{
|
||||||
|
"name": "spine-csharp-tests",
|
||||||
|
"references": [ "spine-csharp" ]
|
||||||
|
}
|
||||||
7
spine-csharp/tests/spine-csharp-tests.asmdef.meta
Normal file
7
spine-csharp/tests/spine-csharp-tests.asmdef.meta
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 55c3c2e44e0ce38458817aeb64482f91
|
||||||
|
AssemblyDefinitionImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
8
spine-csharp/tests/src.meta
Normal file
8
spine-csharp/tests/src.meta
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 65e2134dba09ce14b99b93184153067f
|
||||||
|
folderAsset: yes
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
11
spine-csharp/tests/src/AnimationStateTests.cs.meta
Normal file
11
spine-csharp/tests/src/AnimationStateTests.cs.meta
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 1ba84adcd3d667744bdac5d92c451668
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
@ -1,13 +0,0 @@
|
|||||||
{
|
|
||||||
"name": "SpineTests",
|
|
||||||
"optionalUnityReferences": [
|
|
||||||
"TestAssemblies"
|
|
||||||
],
|
|
||||||
"references" : [
|
|
||||||
"spine-unity",
|
|
||||||
"spine-csharp"
|
|
||||||
],
|
|
||||||
"includePlatforms": [
|
|
||||||
"Editor"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
@ -1 +0,0 @@
|
|||||||
Add the directory content of 'spine-csharp/tests' as 'tests' here (e.g. using a symlink).
|
|
||||||
@ -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 +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 +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 +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": "contact@esotericsoftware.com",
|
||||||
|
"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": "git@github.com: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"
|
||||||
|
}
|
||||||
@ -0,0 +1,7 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 11052e5422ef2be4eae7b875ba449c31
|
||||||
|
PackageManifestImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
@ -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`.
|
||||||
Loading…
x
Reference in New Issue
Block a user