• Home
  • Raw
  • Download

Lines Matching +full:enable +full:- +full:integration +full:- +full:tests

3 # Use of this source code is governed by a BSD-style license that can be
45 Utility structure to join user-provided filter expressions with additional filters
47 See https://nexte.st/book/filter-expressions.html
69 yield "--filter-expr"
79 "--workspace",
80 "--no-default-features" if no_default_features else None,
81 f"--features={features}" if features else None,
98 console.print("Transfering integration tests package...")
119 console.print("Running tests that require root privileges. Refreshing sudo now.")
122 for device in ["/dev/kvm", "/dev/vhost-vsock"]:
129 installed_toolchains = cmd("rustup target list --installed").lines()
132 console.print(f"[green]Tip:[/green] Run tests in the dev container with:")
141 if str(triple) == "x86_64-unknown-linux-gnu":
143 elif str(triple) == "aarch64-unknown-linux-gnu":
145 elif str(triple) == "riscv64gc-unknown-linux-gnu":
148 raise Exception(f"{triple} is not supported for running tests in a VM.")
151 @argh.arg("--filter-expr", "-E", type=str, action="append", help="Nextest filter expression.")
153 "--platform", "-p", help="Which platform to test. (x86_64, aarch64, armhw, mingw64, riscv64)"
155 @argh.arg("--dut", help="Which device to test on. (vm or host)")
156 @argh.arg("--no-default-features", help="Don't enable default features")
157 @argh.arg("--no-run", "--build-only", help="Build only, do not run any tests.")
158 @argh.arg("--no-unit-tests", help="Do not run unit tests.")
159 @argh.arg("--no-integration-tests", help="Do not run integration tests.")
160 @argh.arg("--no-strip", help="Do not strip test binaries of debug info.")
161 @argh.arg("--run-root-tests", help="Enables integration tests that require root privileges.")
163 "--features",
164 help=f"List of comma separated features to be passed to cargo. Defaults to `all-$platform`",
166 @argh.arg("--no-parallel", help="Do not parallelize integration tests. Slower but more stable.")
167 @argh.arg("--repetitions", help="Repeat all tests, useful for checking test stability.")
183 Runs all crosvm tests
185 For details on how crosvm tests are organized, see https://crosvm.dev/book/testing/index.html
189 To run all unit tests for the hosts native architecture:
193 To run all unit tests for another supported architecture using an emulator (e.g. wine64,
196 $ ./tools/run_tests -p aarch64
197 $ ./tools/run_tests -p armhw
198 $ ./tools/run_tests -p mingw64
200 # Integration Tests
202 Integration tests can be run on a built-in virtual machine:
204 $ ./tools/run_tests --dut=vm
205 $ ./tools/run_tests --dut=vm -p aarch64
210 Integration tests can be run on the host machine as well, but cannot be guaranteed to work on
213 $ ./tools/run_tests --dut=host
217 This script supports nextest filter expressions: https://nexte.st/book/filter-expressions.html
219 For example to run all tests in `my-crate` and all crates that depend on it:
221 $ ./tools/run_tests [--dut=] -E 'rdeps(my-crate)'
225 if os.name == "posix" and not cmd("which cargo-nextest").success():
226 raise Exception("Cannot find cargo-nextest. Please re-run `./tools/install-deps`")
227 elif os.name == "nt" and not cmd("where.exe cargo-nextest.exe").success():
228 raise Exception("Cannot find cargo-nextest. Please re-run `./tools/install-deps.ps1`")
241 # Disable the DUT if integration tests are not run.
245 # Automatically enable tests that require root if sudo is passwordless
253 # Print summary of tests and where they will be executed.
257 dut_str = f"Run on built-in {get_vm_arch(triple)} vm"
262 f"--dut={dut} is not supported. Options are --dut=host or --dut=vm (linux only)"
269 console.print(f"Running tests for [green]{triple}[/green]")
272 console.print(f"no-default-features: [green]{no_default_features}[/green]")
274 console.print(f" Unit tests: [bold]{unit_test_str}[/bold]")
275 console.print(f" Integration tests: [bold]{integration_test_str}[/bold]")
283 "[green]Tip:[/green] Skipping tests that require root privileges. "
284 + "Use [bold]--run-root-tests[/bold] to enable them."
288 "[green]Tip:[/green] To run integration tests on a built-in VM: "
289 + "Use [bold]--dut=vm[/bold] (preferred)"
292 "[green]Tip:[/green] To run integration tests on the host: Use "
293 + "[bold]--dut=host[/bold] (fast, but unreliable)"
304 …f"[green]Tip:[/green] The test VM will remain alive between tests. You can manage this VM with [bo…
315 f"--profile={profile}" if profile else None,
316 "--verbose" if verbose() else None,
320 console.rule("Building tests")
323 nextest_args += ["--exclude=" + s for s in DO_NOT_BUILD_RISCV64]
330 returncode = nextest_run.with_args("--no-run").fg(
341 console.rule("Running unit tests")
342 with record_time("Unit Tests"):
347 returncode = nextest_run.with_args("--lib --bins", *unit_test_filter.to_args()).fg(
372 console.rule("Packaging integration tests")
375 "--test *",
376 f"-d {package_dir}",
377 f"-o {package_archive}" if dut != "host" else None,
378 "--no-strip" if no_strip else None,
380 "--verbose" if verbose() else None,
392 console.rule("Running integration tests")
393 with record_time("Integration tests"):
401 "--test-threads=1" if no_parallel else None,
407 … "[green]Tip:[/green] Tests may fail when run in parallel on some platforms. "
408 + "Try re-running with `--no-parallel`"
412 f"[yellow]Tip:[/yellow] Running tests on the host may not be reliable. "
413 "Prefer [bold]--dut=vm[/bold]."