Skip to content

[DX-2992] test: setup alttester, add choose login method to sample app #224

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jul 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -91,4 +91,10 @@ src/Packages/Passport/Runtime/ThirdParty/Gree/Assets/Plugins/WebView.bundle/**/*
*.idea

# Code coverage
sample/ProjectSettings/Packages/com.unity.testtools.codecoverage/Settings.json
sample/ProjectSettings/Packages/com.unity.testtools.codecoverage/Settings.json

# AltTester
sample/AltTester.log

# Crashes
sample/mono_crash*
43 changes: 43 additions & 0 deletions sample/Assets/Editor/MacBuilder.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
#if UNITY_EDITOR_OSX

using UnityEngine;
using UnityEditor;
using AltTester.AltTesterUnitySDK.Editor;
using AltTester.AltTesterUnitySDK;
using System;

public class BuildScript
{
static void BuildForAltTester()
{
try
{
BuildPlayerOptions buildPlayerOptions = new BuildPlayerOptions();
buildPlayerOptions.scenes = new string[] {
"Assets/Scenes/UnauthenticatedScene.unity", "Assets/Scenes/AuthenticatedScene.unity"
};

buildPlayerOptions.locationPathName = "Builds/MacOS/SampleApp.app";
buildPlayerOptions.target = BuildTarget.StandaloneOSX;
buildPlayerOptions.options = BuildOptions.Development | BuildOptions.IncludeTestAssemblies | BuildOptions.AutoRunPlayer;

// Setup for AltTester
var buildTargetGroup = BuildTargetGroup.Standalone;
AltBuilder.AddAltTesterInScriptingDefineSymbolsGroup(buildTargetGroup);
if (buildTargetGroup == UnityEditor.BuildTargetGroup.Standalone)
AltBuilder.CreateJsonFileForInputMappingOfAxis();
var instrumentationSettings = new AltInstrumentationSettings();
AltBuilder.InsertAltInScene(buildPlayerOptions.scenes[0], instrumentationSettings);

var results = BuildPipeline.BuildPlayer(buildPlayerOptions);
AltBuilder.RemoveAltTesterFromScriptingDefineSymbols(BuildTargetGroup.Standalone);

}
catch (Exception exception)
{
Debug.LogException(exception);
}
}
}

#endif
11 changes: 11 additions & 0 deletions sample/Assets/Editor/MacBuilder.cs.meta

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

8 changes: 8 additions & 0 deletions sample/Assets/Resources.meta

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

8 changes: 8 additions & 0 deletions sample/Assets/Resources/AltTester.meta

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

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[{"name":"Horizontal","negativeButton":"left","positiveButton":"right","altPositiveButton":"d","altNegativeButton":"a","type":0,"axisDirection":0},{"name":"Vertical","negativeButton":"down","positiveButton":"up","altPositiveButton":"w","altNegativeButton":"s","type":0,"axisDirection":0},{"name":"Fire1","negativeButton":"","positiveButton":"left ctrl","altPositiveButton":"mouse 0","altNegativeButton":"","type":0,"axisDirection":0},{"name":"Fire2","negativeButton":"","positiveButton":"left alt","altPositiveButton":"mouse 1","altNegativeButton":"","type":0,"axisDirection":0},{"name":"Fire3","negativeButton":"","positiveButton":"left shift","altPositiveButton":"mouse 2","altNegativeButton":"","type":0,"axisDirection":0},{"name":"Jump","negativeButton":"","positiveButton":"space","altPositiveButton":"","altNegativeButton":"","type":0,"axisDirection":0},{"name":"Mouse X","negativeButton":"","positiveButton":"","altPositiveButton":"","altNegativeButton":"","type":1,"axisDirection":0},{"name":"Mouse Y","negativeButton":"","positiveButton":"","altPositiveButton":"","altNegativeButton":"","type":1,"axisDirection":1},{"name":"Mouse ScrollWheel","negativeButton":"","positiveButton":"","altPositiveButton":"","altNegativeButton":"","type":1,"axisDirection":2},{"name":"Horizontal","negativeButton":"","positiveButton":"","altPositiveButton":"","altNegativeButton":"","type":2,"axisDirection":0},{"name":"Vertical","negativeButton":"","positiveButton":"","altPositiveButton":"","altNegativeButton":"","type":2,"axisDirection":1},{"name":"Fire1","negativeButton":"","positiveButton":"joystick button 0","altPositiveButton":"","altNegativeButton":"","type":0,"axisDirection":0},{"name":"Fire2","negativeButton":"","positiveButton":"joystick button 1","altPositiveButton":"","altNegativeButton":"","type":0,"axisDirection":0},{"name":"Fire3","negativeButton":"","positiveButton":"joystick button 2","altPositiveButton":"","altNegativeButton":"","type":0,"axisDirection":0},{"name":"Jump","negativeButton":"","positiveButton":"joystick button 3","altPositiveButton":"","altNegativeButton":"","type":0,"axisDirection":0},{"name":"Submit","negativeButton":"","positiveButton":"return","altPositiveButton":"joystick button 0","altNegativeButton":"","type":0,"axisDirection":0},{"name":"Submit","negativeButton":"","positiveButton":"enter","altPositiveButton":"space","altNegativeButton":"","type":0,"axisDirection":0},{"name":"Cancel","negativeButton":"","positiveButton":"escape","altPositiveButton":"joystick button 1","altNegativeButton":"","type":0,"axisDirection":0},{"name":"Enable Debug Button 1","negativeButton":"","positiveButton":"left ctrl","altPositiveButton":"joystick button 8","altNegativeButton":"","type":0,"axisDirection":0},{"name":"Enable Debug Button 2","negativeButton":"","positiveButton":"backspace","altPositiveButton":"joystick button 9","altNegativeButton":"","type":0,"axisDirection":0},{"name":"Debug Reset","negativeButton":"","positiveButton":"left alt","altPositiveButton":"joystick button 1","altNegativeButton":"","type":0,"axisDirection":0},{"name":"Debug Next","negativeButton":"","positiveButton":"page down","altPositiveButton":"joystick button 5","altNegativeButton":"","type":0,"axisDirection":0},{"name":"Debug Previous","negativeButton":"","positiveButton":"page up","altPositiveButton":"joystick button 4","altNegativeButton":"","type":0,"axisDirection":0},{"name":"Debug Validate","negativeButton":"","positiveButton":"return","altPositiveButton":"joystick button 0","altNegativeButton":"","type":0,"axisDirection":0},{"name":"Debug Persistent","negativeButton":"","positiveButton":"right shift","altPositiveButton":"joystick button 2","altNegativeButton":"","type":0,"axisDirection":0},{"name":"Debug Multiplier","negativeButton":"","positiveButton":"left shift","altPositiveButton":"joystick button 3","altNegativeButton":"","type":0,"axisDirection":0},{"name":"Debug Horizontal","negativeButton":"left","positiveButton":"right","altPositiveButton":"","altNegativeButton":"","type":0,"axisDirection":0},{"name":"Debug Vertical","negativeButton":"down","positiveButton":"up","altPositiveButton":"","altNegativeButton":"","type":0,"axisDirection":0},{"name":"Debug Vertical","negativeButton":"down","positiveButton":"up","altPositiveButton":"","altNegativeButton":"","type":2,"axisDirection":6},{"name":"Debug Horizontal","negativeButton":"left","positiveButton":"right","altPositiveButton":"","altNegativeButton":"","type":2,"axisDirection":5}]

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

Loading
Loading