crosvm/ci/kokoro/windows/crosvm_build.bat
Dennis Kempin 767e094fb8 tools/run_tests: Use triples for arch
Updates run_tests to use cargo style target triples for specifying
build targets. A simple 'aarch64' or 'armhf' was nice while we just
had linux builds. We now are looking at windows and possibly
different toolchain options (e.g. msvc vs gnu), so our old system
was getting confusing and inconsistent.

We used to have some special handling for adding wrappers to test
runs for emulation (e.g. wine, qemu). That logic has been moved
into TestTarget which now contains not just where to run the test
but also how.

Supported are armhf/aarch64 qemu as well as wine64.

The CLI has been updated to match and now uses the build-target
argument instead of arch.

The following combinations have been tested (though not all
combinations actually pass all tests, which is a separate issue).

./tools/run_tests
./tools/run_tests --target=host --build-target=x86_64-unknown-linux-gnu
./tools/run_tests --target=host --build-target=armhf
./tools/run_tests --target=host --build-target=aarch64
./tools/run_tests --target=host --build-target=mingw64
./tools/run_tests --target=vm:aarch64
./tools/run_tests --target=vm:aarch64 --build-target=armhf

BUG=b:233914170
TEST=See above

Change-Id: Ic6dbb5b39788e2573714606d3bb0e7c712032d91
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3739240
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: Dennis Kempin <denniskempin@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
2022-07-01 19:16:59 +00:00

53 lines
1.6 KiB
Batchfile

:: Copyright 2022 The Chromium OS Authors. All rights reserved.
:: Use of this source code is governed by a BSD-style license that can be
:: found in the LICENSE file.
:: Make environment changes (cd, env vars, etc.) local, so they don't affect the calling batch file
setlocal
:: Code under repo is checked out to %KOKORO_ARTIFACTS_DIR%\git.
:: The final directory name in this path is determined by the scm name specified
:: in the job configuration
cd %KOKORO_ARTIFACTS_DIR%\git\crosvm
:: Pin rustup to a known/tested version.
set rustup_version=1.24.3
:: Install rust toolchain through rustup.
echo [%TIME%] installing rustup %rustup_version%
choco install --no-progress -y rustup.install --version=%rustup_version%
:: Reload path for installed rustup binary
call RefreshEnv.cmd
:: Toolchain version and necessary components will be automatically picked
:: up from rust-toolchain
cargo install bindgen
:: Install python. The default kokoro intalled version is 3.7 but linux tests
:: seem to run on 3.9+.
choco install --no-progress -y python --version=3.9.0
:: Reload path for installed rust toolchain.
call RefreshEnv.cmd
:: Log the version of the Rust toolchain
echo [%TIME%] Using Rust toolchain version:
cargo --version
rustc --version
:: Log python version
echo [%TIME%] Python version:
py --version
py -m pip install argh --user
echo [%TIME%] Calling crosvm\tools\clippy
py .\tools\clippy
if %ERRORLEVEL% neq 0 ( exit /b %ERRORLEVEL% )
echo [%TIME%] Calling crosvm\tools\run_tests
py .\tools\run_tests --build-target=x86_64-pc-windows-msvc -v
if %ERRORLEVEL% neq 0 ( exit /b %ERRORLEVEL% )
exit /b %ERRORLEVEL%