diff options
| -rw-r--r-- | tests/autopilot/autopilot/tests/__init__.py | 17 | ||||
| -rwxr-xr-x | tools/autopilot | 2 |
2 files changed, 13 insertions, 6 deletions
diff --git a/tests/autopilot/autopilot/tests/__init__.py b/tests/autopilot/autopilot/tests/__init__.py index 387eee41a..93224bc78 100644 --- a/tests/autopilot/autopilot/tests/__init__.py +++ b/tests/autopilot/autopilot/tests/__init__.py @@ -72,14 +72,25 @@ class LoggedTestCase(TestWithScenarios, TestCase): class VideoCapturedTestCase(LoggedTestCase): """Video capture autopilot tests, saving the results if the test failed.""" + _recording_app = '/usr/bin/recordmydesktop' + _recording_opts = ['--no-sound', '--no-frame', '-o',] + def setUp(self): super(VideoCapturedTestCase, self).setUp() + global video_recording_enabled + if video_recording_enabled and not self._have_recording_app(): + video_recording_enabled = False + logger.warning("Disabling video capture since '%s' is not present", self._recording_app) + if video_recording_enabled: self._test_passed = True self.addOnException(self._on_test_failed) self.addCleanup(self._stop_video_capture) self._start_video_capture() + def _have_recording_app(self): + return os.path.exists(self._recording_app) + def _start_video_capture(self): """Start capturing video.""" args = self._get_capture_command_line() @@ -102,11 +113,7 @@ class VideoCapturedTestCase(LoggedTestCase): def _get_capture_command_line(self): - return ['/usr/bin/recordmydesktop', - '--no-sound', - '--no-frame', - '-o', - ] + return [self._recording_app] + self._recording_opts def _get_capture_output_file(self): return '/tmp/autopilot/%s.ogv' % (self.shortDescription()) diff --git a/tools/autopilot b/tools/autopilot index d23737d47..1c1c52e13 100755 --- a/tools/autopilot +++ b/tools/autopilot @@ -77,7 +77,7 @@ def parse_arguments(): required=False, help='Specify desired output format. Default is "text".') parser_run.add_argument('-r', '--record', action='store_true', default=False, required=False, help="Record failing tests. Required 'recordmydesktop' app to be installed. Videos \ - are stored in /tmp.") + are stored in /tmp/autopilot.") parser_run.add_argument("test", nargs="*", help="Specify tests to run, as listed by the 'list' command") |
