Exemplo n.º 1
0
    def reproduce_crash(self):
        """Reproduce the crash, running gestures if necessary."""

        with Xvfb(self.options.disable_xvfb) as display_name:
            self.environment['DISPLAY'] = display_name

            # stdin needs to be UserStdin. Otherwise, it wouldn't work with gdb.
            process = common.start_execute(self.binary_path,
                                           self.args,
                                           self.build_directory,
                                           env=self.environment,
                                           stdin=common.UserStdin(),
                                           redirect_stderr_to_stdout=True)

            if self.gestures:
                self.run_gestures(process, display_name)

            # read_buffer_length needs to be 1. Otherwise, it wouldn't work well with
            # gdb.
            err, out = common.wait_execute(
                process,
                exit_on_error=False,
                timeout=self.timeout,
                stdout_transformer=output_transformer.Identity(),
                read_buffer_length=1)
            return err, symbolize(out, self.source_directory)
Exemplo n.º 2
0
 def reproduce_crash(self):
     """Reproduce the crash."""
     # read_buffer_length needs to be 1, and stdin needs to be UserStdin.
     # Otherwise, it wouldn't work well with gdb.
     return common.execute(self.binary_path,
                           self.args,
                           self.build_directory,
                           env=self.environment,
                           exit_on_error=False,
                           timeout=self.timeout,
                           stdout_transformer=output_transformer.Identity(),
                           redirect_stderr_to_stdout=True,
                           stdin=common.UserStdin(),
                           read_buffer_length=1)
Exemplo n.º 3
0
 def test_stdin(self):
     """Test stdin."""
     stdin = common.UserStdin()
     self.assertIsNone(stdin.get())
     self.assertEqual('cmd', stdin.update_cmd_log('cmd'))