test: add test for runtime build (#452)

This commit is contained in:
anatawa12 2023-09-26 19:55:39 +09:00 committed by GitHub
parent 11b10a82d5
commit fc1abcfede
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 31 additions and 0 deletions

View File

@ -0,0 +1,28 @@
using NUnit.Framework;
using UnityEditor;
namespace _ModularAvatar.EditModeTests
{
/// <summary>
/// This tests compilation error in runtime build with building asset bundle.
/// </summary>
public class BuildAssetBundle
{
[Test]
public void Build()
{
var path = "Packages/nadena.dev.modular-avatar/Assets/FixedPrefab.prefab";
var assetBundleBuild = new AssetBundleBuild()
{
assetNames = new string[]{ path },
assetBundleName = "asset.unity3d"
};
BuildPipeline.BuildAssetBundles("Assets/",
new [] {assetBundleBuild},
BuildAssetBundleOptions.None,
EditorUserBuildSettings.activeBuildTarget);
}
}
}

View File

@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 40abbf0448b14fdba4be41e41899accb
timeCreated: 1695686965