blob: 31f3ba3493386c73843b6110d73670f020756528 [file] [log] [blame]
# Copyright 2017 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# Script to run all Python unit tests in cros_config.
# Exit immediately if a command exits with a non-zero status.
set -e
# Switch to script directory to constrain testing.
cd "$(dirname "$(realpath -e "${BASH_SOURCE[0]}")")"
python3 -m unittest discover -p '*' -v
# Run linter
# TODO( "cros lint" doesn't work when run as part of
# an ebuild.
if which cros; then
find . -name '*.py' -exec cros lint {} +