Skip to content

Commit

Permalink
test: add test for runtime build (#29)
Browse files Browse the repository at this point in the history
  • Loading branch information
anatawa12 authored Sep 26, 2023
1 parent 9eee71d commit d29e01c
Show file tree
Hide file tree
Showing 4 changed files with 65 additions and 0 deletions.
27 changes: 27 additions & 0 deletions UnitTests~/BuildAssetBundle.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
using NUnit.Framework;
using UnityEditor;

namespace UnitTests
{
/// <summary>
/// This tests compilation error in runtime build with building asset bundle.
/// </summary>
public class BuildAssetBundle
{
[Test]
public void Build()
{
BuildPipeline.BuildAssetBundles("Assets/",
new[]
{
new AssetBundleBuild
{
assetNames = new[] { "Packages/ndmf/UnitTests/Empty.prefab" },
assetBundleName = "asset.unity3d"
}
},
BuildAssetBundleOptions.None,
EditorUserBuildSettings.activeBuildTarget);
}
}
}
3 changes: 3 additions & 0 deletions UnitTests~/BuildAssetBundle.cs.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

32 changes: 32 additions & 0 deletions UnitTests~/Empty.prefab
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &2965276410932660949
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 2047100942362688727}
m_Layer: 0
m_Name: GameObject
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &2047100942362688727
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2965276410932660949}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: -2.9245853, y: -2.553981, z: -7.948901}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
3 changes: 3 additions & 0 deletions UnitTests~/Empty.prefab.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit d29e01c

Please sign in to comment.