blob: 8cc1b4a491a1719593dcdb1b1d3d04e0a4faad6d [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 --py3 {} +