| # Copyright 2010 The ChromiumOS Authors |
| # Distributed under the terms of the GNU General Public License v2 |
| |
| # |
| # Original Author: The ChromiumOS Authors <chromium-os-dev@chromium.org> |
| # Purpose: Eclass for handling autotest deps packages |
| # |
| |
| inherit autotest cros-constants |
| |
| |
| AUTOTEST_CONFIG_LIST="" |
| AUTOTEST_DEPS_LIST="" |
| AUTOTEST_PROFILERS_LIST="" |
| _NEW_AUTOTEST_LANDED_FLAG=1 |
| |
| # |
| # In order to build only deps (call their setup function), we need to have |
| # a test that calls their setup() in its own setup(). This is done by |
| # creating a "fake" test, prebuilding it, and then deleting it after install. |
| # |
| |
| AUTOTEST_FORCE_TEST_LIST="myfaketest" |
| |
| autotest-deponly_src_prepare() { |
| autotest_src_prepare |
| |
| pushd "${AUTOTEST_WORKDIR}/client/site_tests/" 1> /dev/null || die |
| mkdir myfaketest |
| cd myfaketest |
| |
| # NOTE: Here we create a fake test case, that does not do anything except for |
| # setup of all deps. |
| cat << ENDL > myfaketest.py |
| from autotest_lib.client.bin import test, utils |
| |
| class myfaketest(test.test): |
| def setup(self): |
| ENDL |
| |
| for item in ${AUTOTEST_DEPS_LIST}; do |
| echo " self.job.setup_dep(['${item}'])" >> myfaketest.py |
| done |
| |
| chmod a+x myfaketest.py |
| popd 1> /dev/null |
| } |
| |
| autotest-deponly_src_install() { |
| autotest_src_install |
| |
| rm -rf "${D}${AUTOTEST_BASE}/client/site_tests/myfaketest" || die |
| } |
| |
| EXPORT_FUNCTIONS src_prepare src_install |