[ios] Improved test

This commit is contained in:
Mario Zechner 2025-08-11 20:29:54 +02:00
parent cc43fd549b
commit 1627bd81e5
3 changed files with 18 additions and 1 deletions

View File

@ -19,6 +19,14 @@ let package = Package(
.product(name: "SpineSwift", package: "spine-runtimes")
],
path: "src"
),
.executableTarget(
name: "SimpleTest",
dependencies: [
.product(name: "SpineC", package: "spine-runtimes"),
.product(name: "SpineSwift", package: "spine-runtimes")
],
path: "simpletest"
)
]
)

View File

@ -11,4 +11,7 @@ runSkeletonDrawableTest()
// Run the new SpineSwift API test
print("\n=== Testing SpineSwift API ===")
runSkeletonDrawableTestSwift()
print("Starting SpineSwift test...")
print("About to call runSkeletonDrawableTestSwift...")
runSkeletonDrawableTestSwift()
print("SpineSwift test completed")

View File

@ -4,19 +4,25 @@ import SpineSwift
func runSkeletonDrawableTestSwift() {
print("Testing SkeletonDrawable with SpineSwift API...")
print("Step 1: Enable debug extension")
// Enable debug extension if needed
enableDebugExtension(false)
print(" Debug extension configured")
print("Step 2: Load file paths")
// Load atlas and skeleton data
let atlasPath = "../../spine-ts/assets/spineboy.atlas"
let jsonPath = "../../spine-ts/assets/spineboy-pro.json"
print("Step 3: Read atlas file")
// Read atlas file
guard let atlasData = try? String(contentsOfFile: atlasPath, encoding: .utf8) else {
print("❌ Failed to read atlas file: \(atlasPath)")
return
}
print(" Atlas file read successfully")
print("Step 4: Load atlas with SpineSwift API")
// Load atlas
let atlas: Atlas
do {