SlideShare une entreprise Scribd logo
1  sur  19
Télécharger pour lire hors ligne
GenerativeArt—MadewithUnity
Christian Warnecke and Richard Fine
Unite Copenhagen 2019
In this talk
3
— What’s new in the Unity Test Framework
— Putting the Test Framework into practice
— Live demo
4
Unity Test Framework -
what’s new?
What’s new?
5
— Big push towards more flexibility and customization
— Migrated to a package so we can ship updates faster
– This means you get the source code, too!
TestRunner API
6
— Programmatically launch tests
— Retrieve the list of tests
— Register/unregister callbacks
New Callbacks
7
— When a test run starts/stops
— When a test starts/stops
— When building a player for tests
8
Putting it into practice
Splitting Build and Run
9
— Customize the test player build process to:
– Disable auto-run
– Save to a known location, instead of temporary
— Add custom result reporting to save results to a file
Splitting Build and Run - Build
10
[assembly:TestPlayerBuildModifier(typeof(SetupPlaymodeTestPlayer))]
public class SetupPlaymodeTestPlayer : ITestPlayerBuildModifier {
public BuildPlayerOptions ModifyOptions(BuildPlayerOptions playerOptions) {
playerOptions.options &= ~(BuildOptions.AutoRunPlayer | BuildOptions.ConnectToHost);
var buildLocation = Path.GetFullPath("TestPlayers");
var fileName = Path.GetFileName(playerOptions.locationPathName);
if (!string.IsNullOrEmpty(fileName))
buildLocation = Path.Combine(buildLocation, fileName);
playerOptions.locationPathName = buildLocation;
return playerOptions;
}
}
Splitting Build and Run - Save results in run
11
[assembly:TestRunCallback(typeof(ResultSerializer))]
public class ResultSerializer : ITestRunCallback {
public void RunStarted(ITest testsToRun) { }
public void TestStarted(ITest test) { }
public void TestFinished(ITestResult result) { }
public void RunFinished(ITestResult testResults) {
var path = Path.Combine(Application.persistentDataPath, "testresults.xml");
using (var xw = XmlWriter.Create(path, new XmlWriterSettings{Indent = true}))
testResults.ToXml(true).WriteTo(xw);
System.Console.WriteLine($"***nnTEST RESULTS WRITTEN TOnnt{path}nn***");
Application.Quit(testResults.FailCount > 0 ? 1 : 0);
}
}
Launching specific tests from a menu item
12
— Method wired up to menu item as usual ([MenuItem] etc)
— Create instance of a ScriptableObject callback object
— Register/deregister the callbacks in OnEnable/OnDisable
— Set up filters
— Execute
— When finished, display message, open results window, etc
Launching specific tests from a menu item
13
public class RunTestsFromMenu : ScriptableObject, ICallbacks {
[MenuItem(“Tools/Run useful tests”)] public static void DoRunTests() {
CreateInstance<RunTestsFromMenu>().StartTestRun();
}
private void StartTestRun() {
hideFlags = HideFlags.HideAndDontSave;
CreateInstance<TestRunnerApi>().Execute(new ExecutionSettings {
filters = new [] { new Filter{ categoryNames = new[] { “UsefulTests” }}}
});
}
public void OnEnable() { CreateInstance<TestRunnerApi>().RegisterCallbacks(this); }
public void OnDisable() { CreateInstance<TestRunnerApi>().UnregisterCallbacks(this); }
/* ...RunStarted, TestStarted, TestFinished... */
public void RunFinished(ITestResultAdaptor result) {
…
DestroyImmediate(this);
}
}
Running tests before the build
14
— Implement IPreprocessBuildWithReport
— Register a callback to get test results
— Use TestRunnerApi to run specific (Editor) tests
– Filtering by category is a good idea!
– Run synchronously!
— Check for what the results were
— Throw BuildFailedException if anything failed
Running tests before the build - result collector
15
public class ResultCollector : ICallbacks {
public ITestResultAdaptor Result { get; private set; }
public void RunStarted(ITestAdaptor testsToRun) { }
public void TestStarted(ITestAdaptor test) { }
public void TestFinished(ITestResultAdaptor result) { }
public void RunFinished(ITestResultAdaptor result)
{
Result = result;
}
}
Running tests before the build - preprocessor
16
public class RunValidationTestsBeforeBuild : IPreprocessBuildWithReport {
public void OnPreprocessBuild(BuildReport report) {
var results = new ResultCollector();
var api = ScriptableObject.CreateInstance<TestRunnerApi>();
api.RegisterCallbacks(results);
api.Execute(new ExecutionSettings {
runSynchronously = true,
filters = new[] { new Filter {
categoryNames = new[] { $"PreBuildValidationTests" },
testMode = TestMode.EditMode
} }
});
if (resultCollector.results.FailCount > 0)
throw new BuildFailedException($"One or more of the validation tests did not pass.");
}
}
17
Live demo!
Further Resources
18
— https://tinyurl.com/UnityTestFrameworkDocs
— https://tinyurl.com/UnityTestForum
— Ask The Experts
— Questions?
GenerativeArt—MadewithUnity
#unity3d

Contenu connexe

Tendances

【Unite Tokyo 2019】大量のオブジェクトを含む広いステージでも大丈夫、そうDOTSならね
【Unite Tokyo 2019】大量のオブジェクトを含む広いステージでも大丈夫、そうDOTSならね【Unite Tokyo 2019】大量のオブジェクトを含む広いステージでも大丈夫、そうDOTSならね
【Unite Tokyo 2019】大量のオブジェクトを含む広いステージでも大丈夫、そうDOTSならねUnityTechnologiesJapan002
 
【Unite Tokyo 2018 Training Day】C#JobSystem & ECSでCPUを極限まで使い倒そう ~C# JobSystem 編~
【Unite Tokyo 2018 Training Day】C#JobSystem & ECSでCPUを極限まで使い倒そう ~C# JobSystem 編~【Unite Tokyo 2018 Training Day】C#JobSystem & ECSでCPUを極限まで使い倒そう ~C# JobSystem 編~
【Unite Tokyo 2018 Training Day】C#JobSystem & ECSでCPUを極限まで使い倒そう ~C# JobSystem 編~Unity Technologies Japan K.K.
 
【Unite Tokyo 2019】Unity Test Runnerを活用して内部品質を向上しよう
【Unite Tokyo 2019】Unity Test Runnerを活用して内部品質を向上しよう【Unite Tokyo 2019】Unity Test Runnerを活用して内部品質を向上しよう
【Unite Tokyo 2019】Unity Test Runnerを活用して内部品質を向上しようUnityTechnologiesJapan002
 
Unity エディタ拡張
Unity エディタ拡張Unity エディタ拡張
Unity エディタ拡張Shota Baba
 
Azure PlayFab Unity SDK vs C# SDK
Azure PlayFab Unity SDK vs C# SDK Azure PlayFab Unity SDK vs C# SDK
Azure PlayFab Unity SDK vs C# SDK YutoNishine
 
アニメーションとスキニングをBurstで独自実装する.pdf
アニメーションとスキニングをBurstで独自実装する.pdfアニメーションとスキニングをBurstで独自実装する.pdf
アニメーションとスキニングをBurstで独自実装する.pdfinfinite_loop
 
Test driven development with react
Test driven development with reactTest driven development with react
Test driven development with reactLeon Bezuidenhout
 
Azure PlayFab トレーニング資料
Azure PlayFab トレーニング資料Azure PlayFab トレーニング資料
Azure PlayFab トレーニング資料Daisuke Masubuchi
 
ARコンテンツ作成勉強会:UnityとVuforiaではじめるAR [主要部分]
ARコンテンツ作成勉強会:UnityとVuforiaではじめるAR [主要部分]ARコンテンツ作成勉強会:UnityとVuforiaではじめるAR [主要部分]
ARコンテンツ作成勉強会:UnityとVuforiaではじめるAR [主要部分]Takashi Yoshinaga
 
UniTask入門
UniTask入門UniTask入門
UniTask入門torisoup
 
Cinemachineで見下ろし視点のカメラを作る
Cinemachineで見下ろし視点のカメラを作るCinemachineで見下ろし視点のカメラを作る
Cinemachineで見下ろし視点のカメラを作るUnity Technologies Japan K.K.
 
Ferramentas open source para auxiliar os testes de software
Ferramentas open source para auxiliar os testes de softwareFerramentas open source para auxiliar os testes de software
Ferramentas open source para auxiliar os testes de softwareJeremias Araujo
 
【Photon勉強会】1時間でわかるプラグイン開発とその実際(2017/3/23講演)
【Photon勉強会】1時間でわかるプラグイン開発とその実際(2017/3/23講演)【Photon勉強会】1時間でわかるプラグイン開発とその実際(2017/3/23講演)
【Photon勉強会】1時間でわかるプラグイン開発とその実際(2017/3/23講演)Photon運営事務局
 
Unity開発で使える設計の話+Zenjectの紹介
Unity開発で使える設計の話+Zenjectの紹介Unity開発で使える設計の話+Zenjectの紹介
Unity開発で使える設計の話+Zenjectの紹介torisoup
 
【Unite Tokyo 2019】Understanding C# Struct All Things
【Unite Tokyo 2019】Understanding C# Struct All Things【Unite Tokyo 2019】Understanding C# Struct All Things
【Unite Tokyo 2019】Understanding C# Struct All ThingsUnityTechnologiesJapan002
 
JUnit- A Unit Testing Framework
JUnit- A Unit Testing FrameworkJUnit- A Unit Testing Framework
JUnit- A Unit Testing FrameworkOnkar Deshpande
 

Tendances (20)

【Unite Tokyo 2019】大量のオブジェクトを含む広いステージでも大丈夫、そうDOTSならね
【Unite Tokyo 2019】大量のオブジェクトを含む広いステージでも大丈夫、そうDOTSならね【Unite Tokyo 2019】大量のオブジェクトを含む広いステージでも大丈夫、そうDOTSならね
【Unite Tokyo 2019】大量のオブジェクトを含む広いステージでも大丈夫、そうDOTSならね
 
【Unite Tokyo 2018 Training Day】C#JobSystem & ECSでCPUを極限まで使い倒そう ~C# JobSystem 編~
【Unite Tokyo 2018 Training Day】C#JobSystem & ECSでCPUを極限まで使い倒そう ~C# JobSystem 編~【Unite Tokyo 2018 Training Day】C#JobSystem & ECSでCPUを極限まで使い倒そう ~C# JobSystem 編~
【Unite Tokyo 2018 Training Day】C#JobSystem & ECSでCPUを極限まで使い倒そう ~C# JobSystem 編~
 
【Unite Tokyo 2019】Unity Test Runnerを活用して内部品質を向上しよう
【Unite Tokyo 2019】Unity Test Runnerを活用して内部品質を向上しよう【Unite Tokyo 2019】Unity Test Runnerを活用して内部品質を向上しよう
【Unite Tokyo 2019】Unity Test Runnerを活用して内部品質を向上しよう
 
Unity エディタ拡張
Unity エディタ拡張Unity エディタ拡張
Unity エディタ拡張
 
Unityと.NET
Unityと.NETUnityと.NET
Unityと.NET
 
Azure PlayFab Unity SDK vs C# SDK
Azure PlayFab Unity SDK vs C# SDK Azure PlayFab Unity SDK vs C# SDK
Azure PlayFab Unity SDK vs C# SDK
 
JUNit Presentation
JUNit PresentationJUNit Presentation
JUNit Presentation
 
アニメーションとスキニングをBurstで独自実装する.pdf
アニメーションとスキニングをBurstで独自実装する.pdfアニメーションとスキニングをBurstで独自実装する.pdf
アニメーションとスキニングをBurstで独自実装する.pdf
 
Selenium TestNG
Selenium TestNGSelenium TestNG
Selenium TestNG
 
Test driven development with react
Test driven development with reactTest driven development with react
Test driven development with react
 
Azure PlayFab トレーニング資料
Azure PlayFab トレーニング資料Azure PlayFab トレーニング資料
Azure PlayFab トレーニング資料
 
ARコンテンツ作成勉強会:UnityとVuforiaではじめるAR [主要部分]
ARコンテンツ作成勉強会:UnityとVuforiaではじめるAR [主要部分]ARコンテンツ作成勉強会:UnityとVuforiaではじめるAR [主要部分]
ARコンテンツ作成勉強会:UnityとVuforiaではじめるAR [主要部分]
 
UniTask入門
UniTask入門UniTask入門
UniTask入門
 
Cinemachineで見下ろし視点のカメラを作る
Cinemachineで見下ろし視点のカメラを作るCinemachineで見下ろし視点のカメラを作る
Cinemachineで見下ろし視点のカメラを作る
 
Ferramentas open source para auxiliar os testes de software
Ferramentas open source para auxiliar os testes de softwareFerramentas open source para auxiliar os testes de software
Ferramentas open source para auxiliar os testes de software
 
【Photon勉強会】1時間でわかるプラグイン開発とその実際(2017/3/23講演)
【Photon勉強会】1時間でわかるプラグイン開発とその実際(2017/3/23講演)【Photon勉強会】1時間でわかるプラグイン開発とその実際(2017/3/23講演)
【Photon勉強会】1時間でわかるプラグイン開発とその実際(2017/3/23講演)
 
Unity開発で使える設計の話+Zenjectの紹介
Unity開発で使える設計の話+Zenjectの紹介Unity開発で使える設計の話+Zenjectの紹介
Unity開発で使える設計の話+Zenjectの紹介
 
【Unite Tokyo 2019】Understanding C# Struct All Things
【Unite Tokyo 2019】Understanding C# Struct All Things【Unite Tokyo 2019】Understanding C# Struct All Things
【Unite Tokyo 2019】Understanding C# Struct All Things
 
Unity2018/2019における最適化事情
Unity2018/2019における最適化事情Unity2018/2019における最適化事情
Unity2018/2019における最適化事情
 
JUnit- A Unit Testing Framework
JUnit- A Unit Testing FrameworkJUnit- A Unit Testing Framework
JUnit- A Unit Testing Framework
 

Similaire à QA your code: The new Unity Test Framework – Unite Copenhagen 2019

Saucery for Saucelabs
Saucery for SaucelabsSaucery for Saucelabs
Saucery for SaucelabsAndrew Gray
 
Solit 2013, Автоматизация тестирования сложных систем: mixed mode automated t...
Solit 2013, Автоматизация тестирования сложных систем: mixed mode automated t...Solit 2013, Автоматизация тестирования сложных систем: mixed mode automated t...
Solit 2013, Автоматизация тестирования сложных систем: mixed mode automated t...solit
 
Nashville Symfony Functional Testing
Nashville Symfony Functional TestingNashville Symfony Functional Testing
Nashville Symfony Functional TestingBrent Shaffer
 
Introduction to JUnit testing in OpenDaylight
Introduction to JUnit testing in OpenDaylightIntroduction to JUnit testing in OpenDaylight
Introduction to JUnit testing in OpenDaylightOpenDaylight
 
Coded ui - lesson 4 - coded ui test
Coded ui - lesson 4 - coded ui testCoded ui - lesson 4 - coded ui test
Coded ui - lesson 4 - coded ui testOmer Karpas
 
Android Unit Test
Android Unit TestAndroid Unit Test
Android Unit TestPhuoc Bui
 
Tutorial ranorex
Tutorial ranorexTutorial ranorex
Tutorial ranorexradikalzen
 
Unit testing php-unit - phing - selenium_v2
Unit testing   php-unit - phing - selenium_v2Unit testing   php-unit - phing - selenium_v2
Unit testing php-unit - phing - selenium_v2Tricode (part of Dept)
 
So how do I test my Sling application?
 So how do I test my Sling application? So how do I test my Sling application?
So how do I test my Sling application?Robert Munteanu
 
Testing your application on Google App Engine
Testing your application on Google App EngineTesting your application on Google App Engine
Testing your application on Google App EngineInphina Technologies
 
Testing Your Application On Google App Engine
Testing Your Application On Google App EngineTesting Your Application On Google App Engine
Testing Your Application On Google App EngineIndicThreads
 

Similaire à QA your code: The new Unity Test Framework – Unite Copenhagen 2019 (20)

UPC Testing talk 2
UPC Testing talk 2UPC Testing talk 2
UPC Testing talk 2
 
L08 Unit Testing
L08 Unit TestingL08 Unit Testing
L08 Unit Testing
 
Saucery for Saucelabs
Saucery for SaucelabsSaucery for Saucelabs
Saucery for Saucelabs
 
8-testing.pptx
8-testing.pptx8-testing.pptx
8-testing.pptx
 
Solit 2013, Автоматизация тестирования сложных систем: mixed mode automated t...
Solit 2013, Автоматизация тестирования сложных систем: mixed mode automated t...Solit 2013, Автоматизация тестирования сложных систем: mixed mode automated t...
Solit 2013, Автоматизация тестирования сложных систем: mixed mode automated t...
 
Android TDD
Android TDDAndroid TDD
Android TDD
 
N Unit Presentation
N Unit PresentationN Unit Presentation
N Unit Presentation
 
Nashville Symfony Functional Testing
Nashville Symfony Functional TestingNashville Symfony Functional Testing
Nashville Symfony Functional Testing
 
Unit testing
Unit testingUnit testing
Unit testing
 
Introduction to JUnit testing in OpenDaylight
Introduction to JUnit testing in OpenDaylightIntroduction to JUnit testing in OpenDaylight
Introduction to JUnit testing in OpenDaylight
 
Zend Framework 2 - PHPUnit
Zend Framework 2 - PHPUnitZend Framework 2 - PHPUnit
Zend Framework 2 - PHPUnit
 
Coded ui - lesson 4 - coded ui test
Coded ui - lesson 4 - coded ui testCoded ui - lesson 4 - coded ui test
Coded ui - lesson 4 - coded ui test
 
Android Unit Test
Android Unit TestAndroid Unit Test
Android Unit Test
 
Tutorial ranorex
Tutorial ranorexTutorial ranorex
Tutorial ranorex
 
Unit testing php-unit - phing - selenium_v2
Unit testing   php-unit - phing - selenium_v2Unit testing   php-unit - phing - selenium_v2
Unit testing php-unit - phing - selenium_v2
 
So how do I test my Sling application?
 So how do I test my Sling application? So how do I test my Sling application?
So how do I test my Sling application?
 
Junit_.pptx
Junit_.pptxJunit_.pptx
Junit_.pptx
 
Testing your application on Google App Engine
Testing your application on Google App EngineTesting your application on Google App Engine
Testing your application on Google App Engine
 
Testing Your Application On Google App Engine
Testing Your Application On Google App EngineTesting Your Application On Google App Engine
Testing Your Application On Google App Engine
 
Qtp training
Qtp trainingQtp training
Qtp training
 

Plus de Unity Technologies

Build Immersive Worlds in Virtual Reality
Build Immersive Worlds  in Virtual RealityBuild Immersive Worlds  in Virtual Reality
Build Immersive Worlds in Virtual RealityUnity Technologies
 
Augmenting reality: Bring digital objects into the real world
Augmenting reality: Bring digital objects into the real worldAugmenting reality: Bring digital objects into the real world
Augmenting reality: Bring digital objects into the real worldUnity Technologies
 
Let’s get real: An introduction to AR, VR, MR, XR and more
Let’s get real: An introduction to AR, VR, MR, XR and moreLet’s get real: An introduction to AR, VR, MR, XR and more
Let’s get real: An introduction to AR, VR, MR, XR and moreUnity Technologies
 
Using synthetic data for computer vision model training
Using synthetic data for computer vision model trainingUsing synthetic data for computer vision model training
Using synthetic data for computer vision model trainingUnity Technologies
 
The Tipping Point: How Virtual Experiences Are Transforming Global Industries
The Tipping Point: How Virtual Experiences Are Transforming Global IndustriesThe Tipping Point: How Virtual Experiences Are Transforming Global Industries
The Tipping Point: How Virtual Experiences Are Transforming Global IndustriesUnity Technologies
 
Unity Roadmap 2020: Live games
Unity Roadmap 2020: Live games Unity Roadmap 2020: Live games
Unity Roadmap 2020: Live games Unity Technologies
 
Unity Roadmap 2020: Core Engine & Creator Tools
Unity Roadmap 2020: Core Engine & Creator ToolsUnity Roadmap 2020: Core Engine & Creator Tools
Unity Roadmap 2020: Core Engine & Creator ToolsUnity Technologies
 
How ABB shapes the future of industry with Microsoft HoloLens and Unity - Uni...
How ABB shapes the future of industry with Microsoft HoloLens and Unity - Uni...How ABB shapes the future of industry with Microsoft HoloLens and Unity - Uni...
How ABB shapes the future of industry with Microsoft HoloLens and Unity - Uni...Unity Technologies
 
Unity XR platform has a new architecture – Unite Copenhagen 2019
Unity XR platform has a new architecture – Unite Copenhagen 2019Unity XR platform has a new architecture – Unite Copenhagen 2019
Unity XR platform has a new architecture – Unite Copenhagen 2019Unity Technologies
 
Turn Revit Models into real-time 3D experiences
Turn Revit Models into real-time 3D experiencesTurn Revit Models into real-time 3D experiences
Turn Revit Models into real-time 3D experiencesUnity Technologies
 
How Daimler uses mobile mixed realities for training and sales - Unite Copenh...
How Daimler uses mobile mixed realities for training and sales - Unite Copenh...How Daimler uses mobile mixed realities for training and sales - Unite Copenh...
How Daimler uses mobile mixed realities for training and sales - Unite Copenh...Unity Technologies
 
How Volvo embraced real-time 3D and shook up the auto industry- Unite Copenha...
How Volvo embraced real-time 3D and shook up the auto industry- Unite Copenha...How Volvo embraced real-time 3D and shook up the auto industry- Unite Copenha...
How Volvo embraced real-time 3D and shook up the auto industry- Unite Copenha...Unity Technologies
 
Engineering.com webinar: Real-time 3D and digital twins: The power of a virtu...
Engineering.com webinar: Real-time 3D and digital twins: The power of a virtu...Engineering.com webinar: Real-time 3D and digital twins: The power of a virtu...
Engineering.com webinar: Real-time 3D and digital twins: The power of a virtu...Unity Technologies
 
Supplying scalable VR training applications with Innoactive - Unite Copenhage...
Supplying scalable VR training applications with Innoactive - Unite Copenhage...Supplying scalable VR training applications with Innoactive - Unite Copenhage...
Supplying scalable VR training applications with Innoactive - Unite Copenhage...Unity Technologies
 
XR and real-time 3D in automotive digital marketing strategies | Visionaries ...
XR and real-time 3D in automotive digital marketing strategies | Visionaries ...XR and real-time 3D in automotive digital marketing strategies | Visionaries ...
XR and real-time 3D in automotive digital marketing strategies | Visionaries ...Unity Technologies
 
Real-time CG animation in Unity: unpacking the Sherman project - Unite Copenh...
Real-time CG animation in Unity: unpacking the Sherman project - Unite Copenh...Real-time CG animation in Unity: unpacking the Sherman project - Unite Copenh...
Real-time CG animation in Unity: unpacking the Sherman project - Unite Copenh...Unity Technologies
 
Creating next-gen VR and MR experiences using Varjo VR-1 and XR-1 - Unite Cop...
Creating next-gen VR and MR experiences using Varjo VR-1 and XR-1 - Unite Cop...Creating next-gen VR and MR experiences using Varjo VR-1 and XR-1 - Unite Cop...
Creating next-gen VR and MR experiences using Varjo VR-1 and XR-1 - Unite Cop...Unity Technologies
 
What's ahead for film and animation with Unity 2020 - Unite Copenhagen 2019
What's ahead for film and animation with Unity 2020 - Unite Copenhagen 2019What's ahead for film and animation with Unity 2020 - Unite Copenhagen 2019
What's ahead for film and animation with Unity 2020 - Unite Copenhagen 2019Unity Technologies
 
How to Improve Visual Rendering Quality in VR - Unite Copenhagen 2019
How to Improve Visual Rendering Quality in VR - Unite Copenhagen 2019How to Improve Visual Rendering Quality in VR - Unite Copenhagen 2019
How to Improve Visual Rendering Quality in VR - Unite Copenhagen 2019Unity Technologies
 
Digital twins: the power of a virtual visual copy - Unite Copenhagen 2019
Digital twins: the power of a virtual visual copy - Unite Copenhagen 2019Digital twins: the power of a virtual visual copy - Unite Copenhagen 2019
Digital twins: the power of a virtual visual copy - Unite Copenhagen 2019Unity Technologies
 

Plus de Unity Technologies (20)

Build Immersive Worlds in Virtual Reality
Build Immersive Worlds  in Virtual RealityBuild Immersive Worlds  in Virtual Reality
Build Immersive Worlds in Virtual Reality
 
Augmenting reality: Bring digital objects into the real world
Augmenting reality: Bring digital objects into the real worldAugmenting reality: Bring digital objects into the real world
Augmenting reality: Bring digital objects into the real world
 
Let’s get real: An introduction to AR, VR, MR, XR and more
Let’s get real: An introduction to AR, VR, MR, XR and moreLet’s get real: An introduction to AR, VR, MR, XR and more
Let’s get real: An introduction to AR, VR, MR, XR and more
 
Using synthetic data for computer vision model training
Using synthetic data for computer vision model trainingUsing synthetic data for computer vision model training
Using synthetic data for computer vision model training
 
The Tipping Point: How Virtual Experiences Are Transforming Global Industries
The Tipping Point: How Virtual Experiences Are Transforming Global IndustriesThe Tipping Point: How Virtual Experiences Are Transforming Global Industries
The Tipping Point: How Virtual Experiences Are Transforming Global Industries
 
Unity Roadmap 2020: Live games
Unity Roadmap 2020: Live games Unity Roadmap 2020: Live games
Unity Roadmap 2020: Live games
 
Unity Roadmap 2020: Core Engine & Creator Tools
Unity Roadmap 2020: Core Engine & Creator ToolsUnity Roadmap 2020: Core Engine & Creator Tools
Unity Roadmap 2020: Core Engine & Creator Tools
 
How ABB shapes the future of industry with Microsoft HoloLens and Unity - Uni...
How ABB shapes the future of industry with Microsoft HoloLens and Unity - Uni...How ABB shapes the future of industry with Microsoft HoloLens and Unity - Uni...
How ABB shapes the future of industry with Microsoft HoloLens and Unity - Uni...
 
Unity XR platform has a new architecture – Unite Copenhagen 2019
Unity XR platform has a new architecture – Unite Copenhagen 2019Unity XR platform has a new architecture – Unite Copenhagen 2019
Unity XR platform has a new architecture – Unite Copenhagen 2019
 
Turn Revit Models into real-time 3D experiences
Turn Revit Models into real-time 3D experiencesTurn Revit Models into real-time 3D experiences
Turn Revit Models into real-time 3D experiences
 
How Daimler uses mobile mixed realities for training and sales - Unite Copenh...
How Daimler uses mobile mixed realities for training and sales - Unite Copenh...How Daimler uses mobile mixed realities for training and sales - Unite Copenh...
How Daimler uses mobile mixed realities for training and sales - Unite Copenh...
 
How Volvo embraced real-time 3D and shook up the auto industry- Unite Copenha...
How Volvo embraced real-time 3D and shook up the auto industry- Unite Copenha...How Volvo embraced real-time 3D and shook up the auto industry- Unite Copenha...
How Volvo embraced real-time 3D and shook up the auto industry- Unite Copenha...
 
Engineering.com webinar: Real-time 3D and digital twins: The power of a virtu...
Engineering.com webinar: Real-time 3D and digital twins: The power of a virtu...Engineering.com webinar: Real-time 3D and digital twins: The power of a virtu...
Engineering.com webinar: Real-time 3D and digital twins: The power of a virtu...
 
Supplying scalable VR training applications with Innoactive - Unite Copenhage...
Supplying scalable VR training applications with Innoactive - Unite Copenhage...Supplying scalable VR training applications with Innoactive - Unite Copenhage...
Supplying scalable VR training applications with Innoactive - Unite Copenhage...
 
XR and real-time 3D in automotive digital marketing strategies | Visionaries ...
XR and real-time 3D in automotive digital marketing strategies | Visionaries ...XR and real-time 3D in automotive digital marketing strategies | Visionaries ...
XR and real-time 3D in automotive digital marketing strategies | Visionaries ...
 
Real-time CG animation in Unity: unpacking the Sherman project - Unite Copenh...
Real-time CG animation in Unity: unpacking the Sherman project - Unite Copenh...Real-time CG animation in Unity: unpacking the Sherman project - Unite Copenh...
Real-time CG animation in Unity: unpacking the Sherman project - Unite Copenh...
 
Creating next-gen VR and MR experiences using Varjo VR-1 and XR-1 - Unite Cop...
Creating next-gen VR and MR experiences using Varjo VR-1 and XR-1 - Unite Cop...Creating next-gen VR and MR experiences using Varjo VR-1 and XR-1 - Unite Cop...
Creating next-gen VR and MR experiences using Varjo VR-1 and XR-1 - Unite Cop...
 
What's ahead for film and animation with Unity 2020 - Unite Copenhagen 2019
What's ahead for film and animation with Unity 2020 - Unite Copenhagen 2019What's ahead for film and animation with Unity 2020 - Unite Copenhagen 2019
What's ahead for film and animation with Unity 2020 - Unite Copenhagen 2019
 
How to Improve Visual Rendering Quality in VR - Unite Copenhagen 2019
How to Improve Visual Rendering Quality in VR - Unite Copenhagen 2019How to Improve Visual Rendering Quality in VR - Unite Copenhagen 2019
How to Improve Visual Rendering Quality in VR - Unite Copenhagen 2019
 
Digital twins: the power of a virtual visual copy - Unite Copenhagen 2019
Digital twins: the power of a virtual visual copy - Unite Copenhagen 2019Digital twins: the power of a virtual visual copy - Unite Copenhagen 2019
Digital twins: the power of a virtual visual copy - Unite Copenhagen 2019
 

Dernier

08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfhans926745
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 

Dernier (20)

08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 

QA your code: The new Unity Test Framework – Unite Copenhagen 2019

  • 1.
  • 2. GenerativeArt—MadewithUnity Christian Warnecke and Richard Fine Unite Copenhagen 2019
  • 3. In this talk 3 — What’s new in the Unity Test Framework — Putting the Test Framework into practice — Live demo
  • 4. 4 Unity Test Framework - what’s new?
  • 5. What’s new? 5 — Big push towards more flexibility and customization — Migrated to a package so we can ship updates faster – This means you get the source code, too!
  • 6. TestRunner API 6 — Programmatically launch tests — Retrieve the list of tests — Register/unregister callbacks
  • 7. New Callbacks 7 — When a test run starts/stops — When a test starts/stops — When building a player for tests
  • 8. 8 Putting it into practice
  • 9. Splitting Build and Run 9 — Customize the test player build process to: – Disable auto-run – Save to a known location, instead of temporary — Add custom result reporting to save results to a file
  • 10. Splitting Build and Run - Build 10 [assembly:TestPlayerBuildModifier(typeof(SetupPlaymodeTestPlayer))] public class SetupPlaymodeTestPlayer : ITestPlayerBuildModifier { public BuildPlayerOptions ModifyOptions(BuildPlayerOptions playerOptions) { playerOptions.options &= ~(BuildOptions.AutoRunPlayer | BuildOptions.ConnectToHost); var buildLocation = Path.GetFullPath("TestPlayers"); var fileName = Path.GetFileName(playerOptions.locationPathName); if (!string.IsNullOrEmpty(fileName)) buildLocation = Path.Combine(buildLocation, fileName); playerOptions.locationPathName = buildLocation; return playerOptions; } }
  • 11. Splitting Build and Run - Save results in run 11 [assembly:TestRunCallback(typeof(ResultSerializer))] public class ResultSerializer : ITestRunCallback { public void RunStarted(ITest testsToRun) { } public void TestStarted(ITest test) { } public void TestFinished(ITestResult result) { } public void RunFinished(ITestResult testResults) { var path = Path.Combine(Application.persistentDataPath, "testresults.xml"); using (var xw = XmlWriter.Create(path, new XmlWriterSettings{Indent = true})) testResults.ToXml(true).WriteTo(xw); System.Console.WriteLine($"***nnTEST RESULTS WRITTEN TOnnt{path}nn***"); Application.Quit(testResults.FailCount > 0 ? 1 : 0); } }
  • 12. Launching specific tests from a menu item 12 — Method wired up to menu item as usual ([MenuItem] etc) — Create instance of a ScriptableObject callback object — Register/deregister the callbacks in OnEnable/OnDisable — Set up filters — Execute — When finished, display message, open results window, etc
  • 13. Launching specific tests from a menu item 13 public class RunTestsFromMenu : ScriptableObject, ICallbacks { [MenuItem(“Tools/Run useful tests”)] public static void DoRunTests() { CreateInstance<RunTestsFromMenu>().StartTestRun(); } private void StartTestRun() { hideFlags = HideFlags.HideAndDontSave; CreateInstance<TestRunnerApi>().Execute(new ExecutionSettings { filters = new [] { new Filter{ categoryNames = new[] { “UsefulTests” }}} }); } public void OnEnable() { CreateInstance<TestRunnerApi>().RegisterCallbacks(this); } public void OnDisable() { CreateInstance<TestRunnerApi>().UnregisterCallbacks(this); } /* ...RunStarted, TestStarted, TestFinished... */ public void RunFinished(ITestResultAdaptor result) { … DestroyImmediate(this); } }
  • 14. Running tests before the build 14 — Implement IPreprocessBuildWithReport — Register a callback to get test results — Use TestRunnerApi to run specific (Editor) tests – Filtering by category is a good idea! – Run synchronously! — Check for what the results were — Throw BuildFailedException if anything failed
  • 15. Running tests before the build - result collector 15 public class ResultCollector : ICallbacks { public ITestResultAdaptor Result { get; private set; } public void RunStarted(ITestAdaptor testsToRun) { } public void TestStarted(ITestAdaptor test) { } public void TestFinished(ITestResultAdaptor result) { } public void RunFinished(ITestResultAdaptor result) { Result = result; } }
  • 16. Running tests before the build - preprocessor 16 public class RunValidationTestsBeforeBuild : IPreprocessBuildWithReport { public void OnPreprocessBuild(BuildReport report) { var results = new ResultCollector(); var api = ScriptableObject.CreateInstance<TestRunnerApi>(); api.RegisterCallbacks(results); api.Execute(new ExecutionSettings { runSynchronously = true, filters = new[] { new Filter { categoryNames = new[] { $"PreBuildValidationTests" }, testMode = TestMode.EditMode } } }); if (resultCollector.results.FailCount > 0) throw new BuildFailedException($"One or more of the validation tests did not pass."); } }
  • 18. Further Resources 18 — https://tinyurl.com/UnityTestFrameworkDocs — https://tinyurl.com/UnityTestForum — Ask The Experts — Questions?