Merge pull request #50 from Susko3/add-simple-android-tests

Add simple android tests
This commit is contained in:
Dan Balasescu 2024-04-20 14:21:50 +09:00 committed by GitHub
commit a16389d76c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
7 changed files with 53 additions and 2 deletions

1
.gitignore vendored
View File

@ -323,6 +323,7 @@ fabric.properties
**/.idea/**/dynamic.xml
**/.idea/**/uiDesigner.xml
**/.idea/**/dbnavigator.xml
**/.idea/**/deploymentTargetDropDown.xml
# Rider
# Rider auto-generates .iml files, and contentModel.xml

View File

@ -2,7 +2,11 @@
"solution": {
"path": "SDL3-CS.sln",
"projects": [
"SDL3-CS.Android\\SDL3-CS.Android.csproj"
"SDL3-CS\\SDL3-CS.csproj",
"SDL3-CS.SourceGeneration\\SDL3-CS.SourceGeneration.csproj",
"SDL3-CS.Tests\\SDL3-CS.Tests.csproj",
"SDL3-CS.Android\\SDL3-CS.Android.csproj",
"SDL3-CS.Tests.Android\\SDL3-CS.Tests.Android.csproj"
]
}
}

View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<application android:allowBackup="true" android:supportsRtl="true">
</application>
<uses-permission android:name="android.permission.INTERNET"/>
</manifest>

View File

@ -0,0 +1,13 @@
using Java.Lang;
using Org.Libsdl.App;
namespace SDL.Tests.Android
{
[Activity(Label = "SDL3-CS Android Tests", MainLauncher = true)]
public class MainActivity : SDLActivity
{
protected override string[] GetLibraries() => ["SDL3"];
protected override IRunnable CreateSDLMainRunnable() => new Runnable(Program.Main);
}
}

View File

@ -0,0 +1,20 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0-android</TargetFramework>
<SupportedOSPlatformVersion>21</SupportedOSPlatformVersion>
<RootNamespace>SDL.Tests.Android</RootNamespace>
<OutputType>Exe</OutputType>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<ApplicationId>SDL.Tests.Android</ApplicationId>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\SDL3-CS\SDL3-CS.csproj"/>
<ProjectReference Include="..\SDL3-CS.Tests\SDL3-CS.Tests.csproj"/>
<ProjectReference Include="..\SDL3-CS.Android\SDL3-CS.Android.csproj"/>
</ItemGroup>
</Project>

View File

@ -11,7 +11,8 @@ namespace SDL.Tests
{
public static void Main()
{
Console.OutputEncoding = Encoding.UTF8;
if (OperatingSystem.IsWindows())
Console.OutputEncoding = Encoding.UTF8;
SDL_SetHint(SDL_HINT_WINDOWS_CLOSE_ON_ALT_F4, "null byte \0 in string"u8);
Debug.Assert(SDL_GetHint(SDL_HINT_WINDOWS_CLOSE_ON_ALT_F4) == "null byte ");

View File

@ -21,6 +21,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SDL3-CS.Tests", "SDL3-CS.Te
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SDL3-CS.Android", "SDL3-CS.Android\SDL3-CS.Android.csproj", "{CA28F49C-D0BE-47D6-9E82-7A0B8C380B8B}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SDL3-CS.Tests.Android", "SDL3-CS.Tests.Android\SDL3-CS.Tests.Android.csproj", "{E8469DA5-E437-4287-9E2A-8B8F4DC21C1A}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@ -43,6 +45,10 @@ Global
{CA28F49C-D0BE-47D6-9E82-7A0B8C380B8B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{CA28F49C-D0BE-47D6-9E82-7A0B8C380B8B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{CA28F49C-D0BE-47D6-9E82-7A0B8C380B8B}.Release|Any CPU.Build.0 = Release|Any CPU
{E8469DA5-E437-4287-9E2A-8B8F4DC21C1A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E8469DA5-E437-4287-9E2A-8B8F4DC21C1A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E8469DA5-E437-4287-9E2A-8B8F4DC21C1A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E8469DA5-E437-4287-9E2A-8B8F4DC21C1A}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE