Skip to content

Commit

Permalink
[Mono.Android-Tests] Remove obsolete .shproj file. (#9758)
Browse files Browse the repository at this point in the history
`Mono.Android-Tests` still uses a `.shproj` file from the time when we had both a Classic XA and .NET version.  However, VS does not seem to support this anymore, and none of the included files appear in the IDE, making it hard to write new tests.

Remove the `.shproj` file and update the `.csproj` file to directly point to needed files.

Also do some other cleanups like removing tests that are no longer run and fixing directory structure.

Verified that both the `main` version and this PR run 885 tests on CI.
  • Loading branch information
jpobst authored Feb 12, 2025
1 parent 70bd636 commit d376590
Show file tree
Hide file tree
Showing 99 changed files with 252 additions and 726 deletions.
6 changes: 3 additions & 3 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,9 @@
{
"label": "prepare-sample-under-dotnet",
"type": "shell",
"windows": { "command": "dotnet-local.cmd build --no-restore tests/Mono.Android-Tests/Runtime-Microsoft.Android.Sdk/Mono.Android.NET-Tests.csproj -c ${input:configuration} -t:GenerateNuGetConfig -p:AndroidNETTestConfigOutputDir=${workspaceRoot}/samples", },
"linux": { "command": "./dotnet-local.sh build --no-restore tests/Mono.Android-Tests/Runtime-Microsoft.Android.Sdk/Mono.Android.NET-Tests.csproj -c ${input:configuration} -t:GenerateNuGetConfig -p:AndroidNETTestConfigOutputDir=${workspaceRoot}/samples",},
"osx": { "command": "./dotnet-local.sh build --no-restore tests/Mono.Android-Tests/Runtime-Microsoft.Android.Sdk/Mono.Android.NET-Tests.csproj -c ${input:configuration} -t:GenerateNuGetConfig -p:AndroidNETTestConfigOutputDir=${workspaceRoot}/samples",},
"windows": { "command": "dotnet-local.cmd build --no-restore tests/Mono.Android-Tests/Mono.Android-Tests/Mono.Android.NET-Tests.csproj -c ${input:configuration} -t:GenerateNuGetConfig -p:AndroidNETTestConfigOutputDir=${workspaceRoot}/samples", },
"linux": { "command": "./dotnet-local.sh build --no-restore tests/Mono.Android-Tests/Mono.Android-Tests/Mono.Android.NET-Tests.csproj -c ${input:configuration} -t:GenerateNuGetConfig -p:AndroidNETTestConfigOutputDir=${workspaceRoot}/samples",},
"osx": { "command": "./dotnet-local.sh build --no-restore tests/Mono.Android-Tests/Mono.Android-Tests/Mono.Android.NET-Tests.csproj -c ${input:configuration} -t:GenerateNuGetConfig -p:AndroidNETTestConfigOutputDir=${workspaceRoot}/samples",},
"group": {
"kind": "build",
"isDefault": true
Expand Down
4 changes: 2 additions & 2 deletions Documentation/workflow/UnitTests.md
Original file line number Diff line number Diff line change
Expand Up @@ -411,12 +411,12 @@ These tests are generally found in:
These tests are run by using the `RunTestApp` target on the appropriate project
file, which includes:

* `tests/Mono.Android-Tests/Runtime-Microsoft.Android.Sdk/Mono.Android.NET-Tests.csproj`
* `tests/Mono.Android-Tests/Mono.Android-Tests/Mono.Android.NET-Tests.csproj`

For example:

```zsh
./dotnet-local.sh build -t:RunTestApp tests/Mono.Android-Tests/Runtime-Microsoft.Android.Sdk/Mono.Android.NET-Tests.csproj
./dotnet-local.sh build -t:RunTestApp tests/Mono.Android-Tests/Mono.Android-Tests/Mono.Android.NET-Tests.csproj
```

After running the tests, a `TestResult*.xml` file will be created in the
Expand Down
2 changes: 1 addition & 1 deletion build-tools/automation/azure-pipelines-nightly.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ stages:
parameters:
configuration: $(XA.Build.Configuration)
testName: Mono.Android.NET_Tests-$(XA.Build.Configuration)-$(avdApiLevel)
project: tests/Mono.Android-Tests/Runtime-Microsoft.Android.Sdk/Mono.Android.NET-Tests.csproj
project: tests/Mono.Android-Tests/Mono.Android-Tests/Mono.Android.NET-Tests.csproj
testResultsFiles: TestResult-Mono.Android.NET_Tests-$(XA.Build.Configuration)$(avdApiLevel).xml
extraBuildArgs: -p:TestsFlavor=$(avdApiLevel) -p:TestAvdApiLevel=$(avdApiLevel) -p:TestAvdAbi=$(avdAbi) -p:TestAvdType=$(avdType)
artifactSource: bin/Test$(XA.Build.Configuration)/$(DotNetTargetFramework)-android/Mono.Android.NET_Tests-Signed.aab
Expand Down
14 changes: 7 additions & 7 deletions build-tools/automation/yaml-templates/stage-package-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ stages:
buildConfiguration: $(XA.Build.Configuration)
configuration: Debug
testName: Mono.Android.NET_Tests-Debug
project: tests/Mono.Android-Tests/Runtime-Microsoft.Android.Sdk/Mono.Android.NET-Tests.csproj
project: tests/Mono.Android-Tests/Mono.Android-Tests/Mono.Android.NET-Tests.csproj
testResultsFiles: TestResult-Mono.Android.NET_Tests-Debug.xml
artifactSource: bin/TestDebug/$(DotNetTargetFramework)-android/Mono.Android.NET_Tests-Signed.apk
artifactFolder: $(DotNetTargetFramework)-Debug
Expand All @@ -75,7 +75,7 @@ stages:
parameters:
configuration: $(XA.Build.Configuration)
testName: Mono.Android.NET_Tests-$(XA.Build.Configuration)
project: tests/Mono.Android-Tests/Runtime-Microsoft.Android.Sdk/Mono.Android.NET-Tests.csproj
project: tests/Mono.Android-Tests/Mono.Android-Tests/Mono.Android.NET-Tests.csproj
testResultsFiles: TestResult-Mono.Android.NET_Tests-$(XA.Build.Configuration).xml
artifactSource: bin/Test$(XA.Build.Configuration)/$(DotNetTargetFramework)-android/Mono.Android.NET_Tests-Signed.aab
artifactFolder: $(DotNetTargetFramework)-$(XA.Build.Configuration)
Expand All @@ -84,7 +84,7 @@ stages:
parameters:
configuration: $(XA.Build.Configuration)
testName: Mono.Android.NET_Tests-NoAab
project: tests/Mono.Android-Tests/Runtime-Microsoft.Android.Sdk/Mono.Android.NET-Tests.csproj
project: tests/Mono.Android-Tests/Mono.Android-Tests/Mono.Android.NET-Tests.csproj
testResultsFiles: TestResult-Mono.Android.NET_Tests-$(XA.Build.Configuration)NoAab.xml
extraBuildArgs: -p:TestsFlavor=NoAab -p:AndroidPackageFormat=apk
artifactSource: bin/Test$(XA.Build.Configuration)/$(DotNetTargetFramework)-android/Mono.Android.NET_Tests-Signed.apk
Expand All @@ -94,7 +94,7 @@ stages:
parameters:
configuration: $(XA.Build.Configuration)
testName: Mono.Android.NET_Tests-Interpreter
project: tests/Mono.Android-Tests/Runtime-Microsoft.Android.Sdk/Mono.Android.NET-Tests.csproj
project: tests/Mono.Android-Tests/Mono.Android-Tests/Mono.Android.NET-Tests.csproj
testResultsFiles: TestResult-Mono.Android.NET_Tests-$(XA.Build.Configuration)Interpreter.xml
extraBuildArgs: -p:TestsFlavor=Interpreter -p:UseInterpreter=True
artifactSource: bin/Test$(XA.Build.Configuration)/$(DotNetTargetFramework)-android/Mono.Android.NET_Tests-Signed.aab
Expand Down Expand Up @@ -172,7 +172,7 @@ stages:
parameters:
configuration: $(XA.Build.Configuration)
testName: Mono.Android.NET_Tests-NoAot
project: tests/Mono.Android-Tests/Runtime-Microsoft.Android.Sdk/Mono.Android.NET-Tests.csproj
project: tests/Mono.Android-Tests/Mono.Android-Tests/Mono.Android.NET-Tests.csproj
testResultsFiles: TestResult-Mono.Android.NET_Tests-$(XA.Build.Configuration)NoAot.xml
extraBuildArgs: -p:TestsFlavor=NoAot -p:RunAOTCompilation=false
artifactSource: bin/Test$(XA.Build.Configuration)/$(DotNetTargetFramework)-android/Mono.Android.NET_Tests-Signed.aab
Expand All @@ -182,7 +182,7 @@ stages:
parameters:
configuration: $(XA.Build.Configuration)
testName: Mono.Android.NET_Tests-TrimModePartial
project: tests/Mono.Android-Tests/Runtime-Microsoft.Android.Sdk/Mono.Android.NET-Tests.csproj
project: tests/Mono.Android-Tests/Mono.Android-Tests/Mono.Android.NET-Tests.csproj
testResultsFiles: TestResult-Mono.Android.NET_Tests-$(XA.Build.Configuration)TrimModePartial.xml
extraBuildArgs: -p:TestsFlavor=TrimModePartial -p:TrimMode=partial
artifactSource: bin/Test$(XA.Build.Configuration)/$(DotNetTargetFramework)-android/Mono.Android.NET_Tests-Signed.aab
Expand All @@ -192,7 +192,7 @@ stages:
parameters:
configuration: $(XA.Build.Configuration)
testName: Mono.Android.NET_Tests-AotLlvm
project: tests/Mono.Android-Tests/Runtime-Microsoft.Android.Sdk/Mono.Android.NET-Tests.csproj
project: tests/Mono.Android-Tests/Mono.Android-Tests/Mono.Android.NET-Tests.csproj
testResultsFiles: TestResult-Mono.Android.NET_Tests-$(XA.Build.Configuration)AotLlvm.xml
extraBuildArgs: -p:TestsFlavor=AotLlvm -p:EnableLLVM=true -p:AndroidEnableProfiledAot=false
artifactSource: bin/Test$(XA.Build.Configuration)/$(DotNetTargetFramework)-android/Mono.Android.NET_Tests-Signed.aab
Expand Down
32 changes: 0 additions & 32 deletions tests/Mono.Android-Tests/Android.OS/HandlerTest.cs

This file was deleted.

29 changes: 0 additions & 29 deletions tests/Mono.Android-Tests/Localization/LocalizationTests.cs

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@
</PropertyGroup>

<ItemGroup>
<AndroidAsset Include="..\LinkedAssets\linked_text2.txt">
<AndroidAsset Include="..\Mono.Android-Tests\LinkedAssets\linked_text2.txt">
<Link>Assets\linked_text2.txt</Link>
</AndroidAsset>
<AndroidAsset Include="..\LinkedAssets\folder.png">
<AndroidAsset Include="..\Mono.Android-Tests\LinkedAssets\folder.png">
<Link>Assets\LibAssetSubFolder\folder.png</Link>
</AndroidAsset>
</ItemGroup>
Expand Down

This file was deleted.

Loading

0 comments on commit d376590

Please sign in to comment.