Skip to content

Commit

Permalink
test: partial linux support for the integration test
Browse files Browse the repository at this point in the history
  • Loading branch information
vaind committed Feb 16, 2022
1 parent 4e7f8d9 commit fe339cf
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 8 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -183,15 +183,15 @@ jobs:

- name: Integration Test - Build Standalone Player without Sentry SDK
shell: pwsh
run: ./test/Scripts.Integration.Test/integration-build-project.ps1 "$env:UNITY_PATH" Builder.BuildWindowsIl2CPPPlayer
run: ./test/Scripts.Integration.Test/integration-build-project.ps1 "$env:UNITY_PATH"

- name: Integration Test - Add Sentry to test project
shell: pwsh
run: ./test/Scripts.Integration.Test/integration-update-sentry.ps1 "$env:UNITY_PATH"

- name: Integration Test - Build Standalone Player Sentry SDK
shell: pwsh
run: ./test/Scripts.Integration.Test/integration-build-project.ps1 "$env:UNITY_PATH" Builder.BuildWindowsIl2CPPPlayer
run: ./test/Scripts.Integration.Test/integration-build-project.ps1 "$env:UNITY_PATH"

- name: Integration Test - Run Player - Smoke Test
shell: pwsh
Expand Down
5 changes: 3 additions & 2 deletions samples/unity-of-bugs/Assets/Editor/Builder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public static void BuildIl2CPPPlayer(BuildTarget buildTarget)

var buildPlayerOptions = new BuildPlayerOptions
{
scenes = new[] {"Assets/Scenes/1_Bugfarm.unity"},
scenes = new[] { "Assets/Scenes/1_Bugfarm.unity" },
locationPathName = args["buildPath"],
target = buildTarget,
options = BuildOptions.StrictMode,
Expand Down Expand Up @@ -60,6 +60,7 @@ public static void BuildIl2CPPPlayer(BuildTarget buildTarget)

public static void BuildWindowsIl2CPPPlayer() => BuildIl2CPPPlayer(BuildTarget.StandaloneWindows64);
public static void BuildMacIl2CPPPlayer() => BuildIl2CPPPlayer(BuildTarget.StandaloneOSX);
public static void BuildLinuxIl2CPPPlayer() => BuildIl2CPPPlayer(BuildTarget.StandaloneLinux64);
public static void BuildAndroidIl2CPPPlayer() => BuildIl2CPPPlayer(BuildTarget.Android);
public static void BuildIOSPlayer() => BuildIl2CPPPlayer(BuildTarget.iOS);

Expand All @@ -79,7 +80,7 @@ private static void SetupSentryOptions(Dictionary<string, string> args)
{
foreach (var asm in AppDomain.CurrentDomain.GetAssemblies().Where(name => name.FullName.Contains("Sentry")))
{
foreach(var type in asm.GetTypes())
foreach (var type in asm.GetTypes())
{
Debug.LogFormat(LogType.Log, LogOption.NoStacktrace, null, "SetupSentryOptions: Asm {0} Type {1}", asm.FullName, type.FullName);
}
Expand Down
5 changes: 4 additions & 1 deletion test/Scripts.Integration.Test/IntegrationGlobals.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,12 @@ function GetTestAppName
{
return "test.exe"
}
ElseIf ($buildMethod.contains("Linux")) {
return "test"
}
Else
{
Throw "Cannot find Test App name for the current operating system"
Throw "Cannot find Test App name for the given buildMethod: '$buildMethod'"
}
}

Expand Down
3 changes: 3 additions & 0 deletions test/Scripts.Integration.Test/integration-build-project.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ if ("$BuildMethod" -eq "")
{
$BuildMethod = "Builder.BuildWindowsIl2CPPPlayer"
}
ElseIf ($IsLinux) {
$BuildMethod = "Builder.BuildLinuxIl2CPPPlayer"
}
Else
{
Throw "Unsupported build"
Expand Down
16 changes: 13 additions & 3 deletions test/Scripts.Integration.Test/integration-run-smoke-test.ps1
Original file line number Diff line number Diff line change
@@ -1,12 +1,22 @@
. ./test/Scripts.Integration.Test/IntegrationGlobals.ps1


If ($IsMacOS)
{
$testAppPath = $testAppPath + "/Contents/MacOS/$NewProjectName"
$testAppPath = "$NewProjectBuildPath/test.app/Contents/MacOS/$NewProjectName"
}
ElseIf ($IsWindows)
{
$testAppPath = "$NewProjectBuildPath/test.app/Contents/MacOS/test.exe"
}
else
ElseIf ($IsLinux) {
$testAppPath = "$NewProjectBuildPath/test"
bash -c "find $testAppPath -name test"
# $testAppPath = $testAppPath + "/Contents/MacOS/test.exe"
}
Else
{
$testAppPath = $testAppPath + "/Contents/MacOS/test.exe"
Throw "Unsupported build"
}

$process = Start-Process -FilePath "$testAppPath" -ArgumentList "--test", "smoke" -PassThru
Expand Down

0 comments on commit fe339cf

Please sign in to comment.