-
Notifications
You must be signed in to change notification settings - Fork 5k
[Android] Run CoreCLR library tests on Android #114148
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
Changes from 27 commits
88aacc6
42028b6
f45a428
84a9855
a78d0ce
3187139
71db4dd
8d9964c
6250953
56eea59
00a94e1
e3871b2
33a0703
2dcc580
973d81f
b91da90
c6c3696
92a4570
fd82f71
eba4f6c
e10afcc
7ad54e8
c2612e5
e061e9d
10de077
2bf63ac
da3343a
2111a6e
250dfca
876aa62
7eb456e
945560d
b918e27
b0f3952
8be70f0
917fffa
8cae98e
2dc7c73
cf2209f
9c36604
39e9601
c2dc647
adc6b76
046e100
e29ad26
a81d29c
a2700f7
2c48518
da61933
ee7512a
f2d056b
c1eb68e
00fa70b
a54f678
2052db2
83e6860
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
@ECHO OFF | ||
setlocal enabledelayedexpansion | ||
|
||
SET EXECUTION_DIR=%~dp0 | ||
SET ASSEMBLY_NAME=%1 | ||
SET TARGET_ARCH=%2 | ||
SET TARGET_OS=%3 | ||
SET TEST_NAME=%4 | ||
SET REPO_ROOT=%5 | ||
|
||
:Arg_Loop | ||
if "%6" == "" goto ArgsDone | ||
set "__AdditionalArgs=!__AdditionalArgs! %6"&shift&goto Arg_Loop | ||
:ArgsDone | ||
|
||
SET "XHARNESS_OUT=%EXECUTION_DIR%xharness-output" | ||
|
||
cd %EXECUTION_DIR% | ||
|
||
:lock | ||
MKDIR androidtests.lock 2>NUL | ||
IF "%errorlevel%" NEQ "0" ( | ||
ping -n 6 127.0.0.1 >NUL | ||
GOTO :lock | ||
) | ||
|
||
IF [%XHARNESS_CLI_PATH%] NEQ [] ( | ||
:: When running in CI, we only have the .NET runtime available | ||
:: We need to call the XHarness CLI DLL directly via dotnet exec | ||
SET HARNESS_RUNNER=%REPO_ROOT%dotnet.cmd exec "%XHARNESS_CLI_PATH%" | ||
) ELSE ( | ||
SET HARNESS_RUNNER=%REPO_ROOT%dotnet.cmd xharness | ||
) | ||
|
||
%HARNESS_RUNNER% android test --instrumentation="net.dot.MonoRunner" --package-name="net.dot.%ASSEMBLY_NAME%" --app="%EXECUTION_DIR%bin\%TEST_NAME%.apk" --output-directory="%XHARNESS_OUT%" --timeout=1800 %__AdditionalArgs% | ||
|
||
SET EXIT_CODE=%ERRORLEVEL% | ||
|
||
ECHO XHarness artifacts: %XHARNESS_OUT% | ||
|
||
RMDIR /Q androidtests.lock 2>NUL | ||
EXIT /B %EXIT_CODE% | ||
|
||
:: ========== FUNCTIONS ========== | ||
:NORMALIZEPATH | ||
SET RETVAL=%~f1 | ||
EXIT /B |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,15 @@ | ||
<Project> | ||
<PropertyGroup> | ||
<RunScriptWindowsCmd Condition="'$(TargetOS)' == 'windows' and '$(RunScriptWindowsCmd)' == ''">true</RunScriptWindowsCmd> | ||
<RunScriptWindowsCmd Condition="'$(TargetOS)' != 'windows' and '$(RunScriptWindowsCmd)' == ''">false</RunScriptWindowsCmd> | ||
<RunScriptWindowsCmd Condition="'$(OS)' == 'Windows_NT' and '$(RunScriptWindowsCmd)' == ''">true</RunScriptWindowsCmd> | ||
<RunScriptWindowsCmd Condition="'$(OS)' != 'Windows_NT' and '$(RunScriptWindowsCmd)' == ''">false</RunScriptWindowsCmd> | ||
</PropertyGroup> | ||
<PropertyGroup Condition="'$(RunScriptInputName)' == ''"> | ||
<RunScriptInputName Condition="'$(RunScriptWindowsCmd)' == 'true'">RunnerTemplate.cmd</RunScriptInputName> | ||
<RunScriptInputName Condition="'$(RunScriptWindowsCmd)' != 'true'">RunnerTemplate.sh</RunScriptInputName> | ||
<RunScriptInputName Condition="'$(BuildTestsOnHelix)' == 'true' and '$(TargetsAppleMobile)' == 'true'">AppleHelixRunnerTemplate.sh</RunScriptInputName> | ||
<RunScriptInputName Condition="'$(BuildTestsOnHelix)' != 'true' and '$(TargetsAppleMobile)' == 'true'">AppleRunnerTemplate.sh</RunScriptInputName> | ||
<RunScriptInputName Condition="'$(TargetOS)' == 'android'">AndroidRunnerTemplate.sh</RunScriptInputName> | ||
<RunScriptInputName Condition="'$(TargetOS)' == 'android' and '$(OS)' != 'Windows_NT'">AndroidRunnerTemplate.sh</RunScriptInputName> | ||
<RunScriptInputName Condition="'$(TargetOS)' == 'android' and '$(OS)' == 'Windows_NT'">AndroidRunnerTemplate.cmd</RunScriptInputName> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why is the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This script is used to run tests from Windows, it generating a batch script that runs and invokes xharness. /cc: @steveisok There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So it is mostly for local testing? We have Mono Android runs which use Windows hosts and invoke xharness to run tests on connected Android devices. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, it is for local testing. What we use on helix is different |
||
<RunScriptInputName Condition="'$(TargetOS)' == 'wasi' and '$(OS)' != 'Windows_NT'">WasiRunnerTemplate.sh</RunScriptInputName> | ||
<RunScriptInputName Condition="'$(TargetOS)' == 'wasi' and '$(OS)' == 'Windows_NT'">WasiRunnerTemplate.cmd</RunScriptInputName> | ||
<RunScriptInputName Condition="'$(TargetOS)' == 'browser' and '$(OS)' != 'Windows_NT'">WasmRunnerTemplate.sh</RunScriptInputName> | ||
|
@@ -172,7 +173,8 @@ TEST_ARCH=$(_AndroidArchitecture) | |
<PropertyGroup Condition="'$(TargetsMobile)' == 'true'"> | ||
<RunTestsCommand>"$(RunScriptOutputPath)" $(AssemblyName) $(TargetArchitecture) $(TargetOS) $(TestProjectName)</RunTestsCommand> | ||
<RunTestsCommand Condition="'$(TargetsAppleMobile)' == 'true'">$(RunTestsCommand) $(Configuration) $(AdditionalXHarnessArguments)</RunTestsCommand> | ||
<RunTestsCommand Condition="'$(TargetOS)' == 'android'">$(RunTestsCommand) $(AdditionalXHarnessArguments)</RunTestsCommand> | ||
<RunTestsCommand Condition="'$(TargetOS)' == 'android' and '$(OS)' != 'Windows_NT'">$(RunTestsCommand) $(AdditionalXHarnessArguments)</RunTestsCommand> | ||
<RunTestsCommand Condition="'$(TargetOS)' == 'android' and '$(OS)' == 'Windows_NT'">$(RunTestsCommand) $(RepoRoot) $(AdditionalXHarnessArguments)</RunTestsCommand> | ||
<RunTestsCommand Condition="'$(TargetOS)' == 'browser'">"$(RunScriptOutputPath)" $(JSEngine) $(AssemblyName).dll $(Scenario)</RunTestsCommand> | ||
</PropertyGroup> | ||
|
||
|
Uh oh!
There was an error while loading. Please reload this page.