| #!/bin/bash |
| # Copyright 2020 The Fuchsia Authors. All rights reserved. |
| # Use of this source code is governed by a BSD-style license that can be |
| # found in the LICENSE file. |
| |
| #### CATEGORY=Test |
| ### run zircon core-tests |
| |
| ## Usage: core-tests [options] [`fx run-boot-test` switches...] |
| ## |
| ## Options: |
| ## --gtest_filter=<FILTER> Define which test cases to run using a pattern [default: *] |
| ## --gtest_repeat=<REPEAT> The number of times to repeat the test suite [default: 1] |
| ## --kernel=<TYPE> The "type" of kernel image to run the core tests against. Kernel |
| ## image names are enumerated under //zircon/kernel/image as directory |
| ## names, and valid values for this type are the images enumerated in |
| ## the value of `[eng] + extra_kernel_test_images`, per |
| ## //build/testing/boot_tests/kernel_zbi_test.gni. [default: eng] |
| ## |
| |
| source "$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)"/../lib/vars.sh || exit $? |
| |
| ARGS=() |
| TYPE="eng" |
| for arg in "$@"; do |
| case "$arg" in |
| --gtest_*) ARGS+=(--cmdline="$arg") ;; |
| --kernel=*) TYPE="${arg#*=}" ;; |
| *) ARGS+=("$arg") ;; |
| esac |
| done |
| |
| fx-command-exec run-boot-test "${ARGS[@]}" "core-tests.${TYPE}" |