| #!/bin/bash |
| # Copyright 2018 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 |
| #### DEPRECATED |
| ### build and run tests on host |
| |
| ## Usage: fx run-host-tests [-z] [host test names ...] [-- [test runner flags]] |
| ## |
| ## This command is being deprecated in favor of `fx test`. Read more at: |
| ## https://fuchsia.dev/fuchsia-src/development/testing/running_tests_as_components#running_tests\n |
| ## |
| ## Builds and runs the given host tests. |
| ## Test runner flags can typically be --gtest_filter=TestSuiteName.TestName |
| ## to restrict to a particular test or set of tests. |
| |
| set -o errexit |
| set -o pipefail |
| |
| source "$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)"/lib/vars.sh || exit $? |
| source "$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)"/lib/host_symbolizer.sh || exit $? |
| fx-config-read |
| |
| fx-warn "This command is being deprecated in favor of \`fx test\`.\n Usage: fx test <TEST_NAME>\n To run end-to-end tests: fx test --e2e <TEST_NAME>\n For more information, visit: https://fuchsia.dev/fuchsia-src/development/testing/run_fuchsia_tests\n" |
| |
| TEST_NAMES=() |
| function main { |
| while [[ -n "$1" ]]; do |
| case "$1" in |
| # break at bare double dash |
| # allow passing args to runtests |
| --) shift |
| break |
| ;; |
| *) TEST_NAMES+=("$1");; |
| esac |
| shift |
| done |
| |
| |
| "${FUCHSIA_DIR}/tools/devshell/contrib/exec-host-tests"\ |
| "--manifest" "${FUCHSIA_BUILD_DIR}/tests.json"\ |
| "--names" "${TEST_NAMES[@]}"\ |
| "--build-dir" "${FUCHSIA_BUILD_DIR}"\ |
| "--ninja" "${PREBUILT_NINJA}" \ |
| "--"\ |
| "$@" |
| } |
| |
| main "$@" |