| #!/bin/bash |
| # |
| # Copyright 2022 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. |
| # |
| # Runs local tests for all workflow scripts. Not runnable on CQ. |
| # |
| # Usage: |
| # $FUCHSIA_EMBEDDER_DIR/scripts/tests/run_unittest.sh |
| |
| set -e # Fail on any error. |
| source "$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)"/../lib/helpers.sh || exit $? |
| |
| tests=( "${FUCHSIA_EMBEDDER_DIR}"/src/embedder/*_unittests.cc ) |
| |
| for test in "${tests[@]}" |
| do |
| # Convert filename to test name by removing prefix path and extension |
| test_name=$(basename $test .cc) |
| echo-info "Running $test_name ..." |
| "${FUCHSIA_EMBEDDER_DIR}"/tools/bazel test //src/embedder:${test_name}_pkg --config=fuchsia_x64 |
| done |