Execute the command on the device. This pushes all required files to the device and then runs the command.
(self, **additional_popen_kwargs)
| 370 | self.files_to_push = test_case_resources + files_from_args |
| 371 | |
| 372 | def execute(self, **additional_popen_kwargs): |
| 373 | """Execute the command on the device. |
| 374 | |
| 375 | This pushes all required files to the device and then runs the command. |
| 376 | """ |
| 377 | if self.verbose: |
| 378 | print('# %s' % self) |
| 379 | |
| 380 | shell_name = self.shell.name |
| 381 | shell_dir = self.shell.parent |
| 382 | |
| 383 | self.driver.push_executable(shell_dir, 'bin', shell_name) |
| 384 | self.push_test_resources() |
| 385 | |
| 386 | start_time = time.time() |
| 387 | return_code = 0 |
| 388 | timed_out = False |
| 389 | try: |
| 390 | stdout = self.driver.run( |
| 391 | 'bin', shell_name, self.args, '.', self.timeout, self.env) |
| 392 | except CommandFailedException as e: |
| 393 | return_code = e.status |
| 394 | stdout = e.output |
| 395 | except TimeoutException as e: |
| 396 | return_code = 1 |
| 397 | timed_out = True |
| 398 | # Sadly the Android driver doesn't provide output on timeout. |
| 399 | stdout = '' |
| 400 | |
| 401 | end_time = time.time() |
| 402 | return output.Output( |
| 403 | return_code, |
| 404 | timed_out, |
| 405 | stdout, |
| 406 | '', # No stderr available. |
| 407 | -1, # No pid available. |
| 408 | start_time, |
| 409 | end_time, |
| 410 | ) |
| 411 | |
| 412 | def push_test_resources(self): |
| 413 | for abs_file in self.files_to_push: |
nothing calls this directly
no test coverage detected