blob: 271bff939d3202c2171c853c2c57a66450db7e25 [file] [log] [blame]
Zdenek Behanefcc64b2011-01-11 04:54:42 +01001# Copyright (c) 2010 The Chromium OS Authors. All rights reserved.
2# Distributed under the terms of the GNU General Public License v2
3
4#
5# Original Author: The Chromium OS Authors <chromium-os-dev@chromium.org>
6# Purpose: Eclass for handling autotest deps packages
7#
8
Aviv Keshet4144c8d2013-07-22 10:52:53 -07009inherit autotest cros-constants
Zdenek Behanefcc64b2011-01-11 04:54:42 +010010
Nick Sandersf9c41702011-01-13 22:03:16 -080011
12AUTOTEST_CONFIG_LIST=""
13AUTOTEST_DEPS_LIST=""
14AUTOTEST_PROFILERS_LIST=""
Aviv Keshet4144c8d2013-07-22 10:52:53 -070015_NEW_AUTOTEST_LANDED_FLAG=1
Nick Sandersf9c41702011-01-13 22:03:16 -080016
Zdenek Behanefcc64b2011-01-11 04:54:42 +010017#
18# In order to build only deps (call their setup function), we need to have
19# a test that calls their setup() in its own setup(). This is done by
20# creating a "fake" test, prebuilding it, and then deleting it after install.
21#
22
23AUTOTEST_FORCE_TEST_LIST="myfaketest"
24
25autotest-deponly_src_prepare() {
26 autotest_src_prepare
27
28 pushd "${AUTOTEST_WORKDIR}/client/site_tests/" 1> /dev/null || die
29 mkdir myfaketest
30 cd myfaketest
31
32 # NOTE: Here we create a fake test case, that does not do anything except for
33 # setup of all deps.
34cat << ENDL > myfaketest.py
35from autotest_lib.client.bin import test, utils
36
37class myfaketest(test.test):
38 def setup(self):
39ENDL
40
41 for item in ${AUTOTEST_DEPS_LIST}; do
42echo " self.job.setup_dep(['${item}'])" >> myfaketest.py
43 done
44
45 chmod a+x myfaketest.py
46 popd 1> /dev/null
47}
48
49autotest-deponly_src_install() {
50 autotest_src_install
51
Aviv Keshet4144c8d2013-07-22 10:52:53 -070052 rm -rf "${D}${AUTOTEST_BASE}/client/site_tests/myfaketest" || die
Zdenek Behanefcc64b2011-01-11 04:54:42 +010053}
54
55EXPORT_FUNCTIONS src_prepare src_install