blob: cc9d884ee6addb27e9c5bf2ac66fa27d71e9f03b [file] [log] [blame]
#!/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=Run, inspect and debug
#### 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 $?
fx-config-read
fx-warn "This command is being deprecated in favor of \`fx test\`. Read more at:\n - https://fuchsia.dev/fuchsia-src/development/testing/running_tests_as_components#converting_from_run-test_or_run-host-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 "$@"