blob: 59dd36d7db0de77b1ef7cc33256185ee2aab5e1f [file] [log] [blame]
# Copyright (c) 2011 The Chromium OS Authors. All rights reserved.
# Distributed under the terms of the GNU General Public License v2
EAPI="4"
CROS_WORKON_COMMIT="6d240e48b723b187329b617dcca46f5e323aa387"
CROS_WORKON_TREE="c8f339333b7c9598387b866430e3ce9ef78e7956"
CROS_WORKON_PROJECT="chromiumos/chromite"
CROS_WORKON_LOCALNAME="../../chromite"
CROS_WORKON_OUTOFTREE_BUILD=1
inherit cros-workon python
DESCRIPTION="Wrapper for running chromite unit tests"
HOMEPAGE="http://www.chromium.org/"
LICENSE="BSD-Google"
SLOT="0"
KEYWORDS="*"
IUSE="cros_host"
src_install() {
use cros_host && return
insinto "$(python_get_sitedir)/chromite"
doins -r "${S}"/*
# TODO (crbug.com/346859) Convert to using distutils and a setup.py
# to specify which files should be installed.
cd "${D}/$(python_get_sitedir)/chromite"
find '(' -name '*.pyc' -o -name '*unittest.py' ')' -delete
rm -rf third_party/pyelftools/test
}
src_test() {
# Run the chromite unit tests, resetting the environment to the standard
# one using a sudo invocation.
cd "${S}"/buildbot && sudo -u "${PORTAGE_USERNAME}" \
PATH="${CROS_WORKON_SRCROOT}/../depot_tools:${PATH}" ./run_tests || die
}