Miyamasu
Unity unit test runner.
Install / Use
/learn @sassembla/MiyamasuREADME
Miyamasu
Make asynchronous tests on Device easy.
for Unity 5.6 or later.

Motivation
Running Unity Tests on Devices and show results. Also running Unity Tests on Editor.
How to test sample project
- Open Window > Test Runner > click PlayMode button.
- click Create PlayMode test button.
- Restart Unity once.
- Open /Assets/SampleScene.unity
- All sample tests will run automatically when play.(for Player)
- or, click RunAll button on Test Runner window.(for Editor)
Install Miyamasu to your project
- Open Window > Test Runner > click PlayMode button.
- click Create PlayMode test button.
- Restart Unity once.
- Open "MiyamasuTestRunner.unitypackage".
- write new test in your Assets/ folder.
Example of test
using System;
using System.Collections;
using UnityEngine;
using Miyamasu;
public class SuccessSample : MiyamasuTestRunner {
// MSetup is annotation for setup.
// method should return void or IEnumerator.
[MSetup] public void Setup () {
Debug.Log("setup!");
}
// MTeardown is annotation for setup.
// method should return void or IEnumerator.
[MTeardown] public void Teardown () {
Debug.Log("Teardown!");
}
// MTest is annotation for test case.
// method should return IEnumerator.
[MTest] public IEnumerator Same () {
AreEqual("a", "a");
yield return null;
}
[MTest] public IEnumerator DoneInTime () {
var obj = new GameObject("runner");
IsNotNull(obj);
var runner = obj.AddComponent<Runner>();
// WaitUntil method can wait that some condition is achieved.
// 1st func<bool> is the condition of this waiting. when returns true, finish waiting.
// 2nd action is for throw timeout exception. you can set original message for fail by timeout.
// 3rd double parameter is time limit in sec. default is 5sec.
yield return WaitUntil(
() => runner.n == 10,// enough small.
() => {throw new TimeoutException("not yet. runner.n:" + runner.n);},
1.0//sec
);
}
}
Run tests and Settings
You can run miyamasu tests both UnityEditor and device.
see Unity > Window > Miyamasu Test Runner > Open Settings.
if "runOnPlay" is checked, all tests will run on Play, even if running on Device. else, you can run tests by Unity -> Window -> TestRunner -> PlayMode button -> Run tests which you need.
Future
- run on UnityCloudBuild.
- device tests orchestration.
- send failed test logs to Slack.
- accept command from Slack then run specific tests on device.
License
see below.
LICENSE
Related Skills
node-connect
348.5kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
109.1kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
348.5kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
348.5kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
