| """Build step class for building OTA tests..""" |
| |
| from __future__ import absolute_import |
| from slave import base_step |
| from slave.step import ota_step |
| |
| |
| class OtaBuildTestsStep(ota_step.OtaStep): |
| """Build step class for building OTA tests.""" |
| |
| def __init__(self, build_name, board_name=None, **kwargs): |
| """Creates a OtaBuildTestsStep instance. |
| |
| Args: |
| build_name: Name of build (e.g. anchovy-eng, tvdefault-eng) |
| board_name: optional BOARD_NAME param for make if any. |
| **kwargs: Any additional args to pass to BaseStep. |
| """ |
| ota_step.OtaStep.__init__(self, build_name=build_name, |
| name='build ota tests', |
| board_name=board_name, **kwargs) |
| |
| def run(self): |
| """Builds ota tests. |
| |
| Returns: |
| True iff there were no errors. |
| """ |
| # Because the out/host directory is shared, the host tests can fail if |
| # the intermediate artifacts are not cleared and rebuilt correctly. Force |
| # all of out/hosts to get rebuilt everytime by clearing out/host entirely. |
| command = ['rm', '-rf', 'out/host'] |
| self.exec_subprocess(command) |
| |
| command = ['make', |
| '-j{}'.format(self.get_num_jobs( |
| multiplier=ota_step.BUILD_ACCELERATION_JOB_MULTIPLIER)), |
| 'PRODUCT-' + self._build_name, |
| 'tests-build-target', |
| 'DISABLE_AUTO_INSTALLCLEAN=true'] |
| command += self.build_accelerator.make_flags |
| command += self._make_extra_flags() |
| |
| returncode, stdout, stderr = self.exec_subprocess( |
| command, env=self.make_command_env()) |
| |
| if returncode != 0: |
| self._error_processor(stdout, stderr) |
| |
| return returncode == 0 |