Skip to content

Commit 41943b5

Browse files
committed
Test fixes
1 parent cae20bb commit 41943b5

4 files changed

Lines changed: 27 additions & 40 deletions

File tree

‎com.unity.netcode.gameobjects/Tests/Editor/Build/BuildTests.cs‎

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,7 @@ internal class BuildTests
1212
{
1313
public const string DefaultBuildScenePath = "Tests/Editor/Build/BuildTestScene.unity";
1414

15-
// Increased the Build test timeout from 3 to 10 minutes.
16-
[Timeout(900000)]
15+
[Timeout(1500000)]
1716
[Test]
1817
public void BasicBuildTest()
1918
{
@@ -25,12 +24,9 @@ public void BasicBuildTest()
2524

2625
if (buildTargetSupported)
2726
{
28-
// Netcode for Entities' build preprocessor writes an asset under this folder and errors if the parent does not already exist.
29-
if (!AssetDatabase.IsValidFolder("Assets/netcode-build-assets-temp"))
30-
{
31-
AssetDatabase.CreateFolder("Assets", "netcode-build-assets-temp");
32-
AssetDatabase.Refresh();
33-
}
27+
// Netcode for Entities' build preprocessor writes an asset under this folder and errors if the parent does not already exist; the folder is recreated unconditionally because --clean-library-on-rerun leaves it unimported between attempts.
28+
Directory.CreateDirectory("Assets/netcode-build-assets-temp");
29+
AssetDatabase.Refresh(ImportAssetOptions.ForceSynchronousImport);
3430

3531
var buildReport = BuildPipeline.BuildPlayer(
3632
new[] { Path.Combine(packagePath, DefaultBuildScenePath) },
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#if UNITY_IOS
2+
using UnityEditor;
3+
using UnityEditor.Build;
4+
using UnityEditor.Build.Reporting;
5+
6+
public class IOSBuildPreprocessor : IPreprocessBuildWithReport
7+
{
8+
public int callbackOrder => 0;
9+
10+
public void OnPreprocessBuild(BuildReport report)
11+
{
12+
if (report.summary.platform != BuildTarget.iOS)
13+
{
14+
return;
15+
}
16+
17+
// The Debug IL2CPP test binary otherwise exceeds the 128MB ARM64 B/BL branch range at link
18+
// time; full generic sharing keeps GameAssembly small enough for the default linker.
19+
PlayerSettings.SetIl2CppCodeGeneration(NamedBuildTarget.iOS, Il2CppCodeGeneration.OptimizeSize);
20+
}
21+
}
22+
#endif

testproject/Assets/Editor/IOSLinkerPostProcessor.cs.meta renamed to testproject/Assets/Editor/IOSBuildPreprocessor.cs.meta

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎testproject/Assets/Editor/IOSLinkerPostProcessor.cs‎

Lines changed: 0 additions & 31 deletions
This file was deleted.

0 commit comments

Comments
 (0)