Files
dotnet-runtime/eng/testing/BionicRunnerTemplate.cmd
T
Jo Shields b5f9c224e7 Linux-bionic (Android libc w/o Android interop) initial implementation (#66147)
Implement support for "Linux Bionic", a RID which builds a Linux runtime against an Android libc but without Android OS functions like JNI, Dalvik, Instrumentation, etc. This configuration has been requested by a team working on an IoT scenario.

* The new RID is linux-bionic-arm64/linux-bionic-x64.
* The build reuses the existing Android build dockerfiles and Helix queues
* Since we don't have JNI, we don't have Android Crypto - instead, use an Android build of OpenSSL. As an errata, it is incumbent upon the end user to supply this in their OS environment (we download one ad-hoc for testing purposes, which was compiled by Google)
* Some tests cannot be completed due to SELinux policies affecting the shell user executing tests via adb shell in the world-writable /data/local/tmp directory. We expect those tests would pass if they pass on Android, in a real-world IoT scenario with a custom OS (rather than recycling Google's OS images intended for phones)

Closes: #66027
2022-05-19 15:27:40 -04:00

57 lines
1.5 KiB
Batchfile

@ECHO OFF
setlocal enabledelayedexpansion
FOR /F "tokens=*" %%i IN ('type TestEnv.txt') DO SET %%i
SET EXECUTION_DIR=%~dp0
SET RUNTIME_PATH=%2
IF [%HELIX_WORKITEM_UPLOAD_ROOT%] == [] (
SET "XHARNESS_OUT=%EXECUTION_DIR%xharness-output"
) ELSE (
SET "XHARNESS_OUT=%HELIX_WORKITEM_UPLOAD_ROOT%\xharness-output"
)
FOR /F %%i IN ("%ASSEMBLY_NAME%") DO @SET TEST_SCRIPT=%%~ni.sh
IF /I [%1] NEQ [--runtime-path] (
ECHO You must specify the runtime path with --runtime-path C:\path\to\runtime
EXIT /b 1
)
SET ADDITIONAL_ARGS=%3 %4 %5 %6 %7 %8 %9
CALL :NORMALIZEPATH "%RUNTIME_PATH%"
SET RUNTIME_PATH=%RETVAL%
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=dotnet.exe exec "%XHARNESS_CLI_PATH%"
) ELSE (
SET HARNESS_RUNNER=dotnet.exe xharness
)
%HARNESS_RUNNER% android-headless test --test-path=%EXECUTION_DIR% --runtime-folder=%RUNTIME_PATH% --test-assembly=%ASSEMBLY_NAME% --device-arch=%TEST_ARCH% --test-script=%TEST_SCRIPT% --output-directory=%XHARNESS_OUT% --timeout=1800 -v %ADDITIONAL_ARGS%
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