aboutsummaryrefslogtreecommitdiffstats
path: root/3rdparty/googletest/googlemock/docs/KnownIssues.md
blob: adadf5144b1b5ba6b4bda7ca86087e28461a8199 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
As any non-trivial software system, Google Mock has some known limitations and problems.  We are working on improving it, and welcome your help!  The follow is a list of issues we know about.



## README contains outdated information on Google Mock's compatibility with other testing frameworks ##

The `README` file in release 1.1.0 still says that Google Mock only works with Google Test.  Actually, you can configure Google Mock to work with any testing framework you choose.

## Tests failing on machines using Power PC CPUs (e.g. some Macs) ##

`gmock_output_test` and `gmock-printers_test` are known to fail with Power PC CPUs.  This is due to portability issues with these tests, and is not an indication of problems in Google Mock itself.  You can safely ignore them.

## Failed to resolve libgtest.so.0 in tests when built against installed Google Test ##

This only applies if you manually built and installed Google Test, and then built a Google Mock against it (either explicitly, or because gtest-config was in your path post-install). In this situation, Libtool has a known issue with certain systems' ldconfig setup:

http://article.gmane.org/gmane.comp.sysutils.automake.general/9025

This requires a manual run of "sudo ldconfig" after the "sudo make install" for Google Test before any binaries which link against it can be executed. This isn't a bug in our install, but we should at least have documented it or hacked a work-around into our install. We should have one of these solutions in our next release.
{ color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
#============================================================================
# This library is free software; you can redistribute it and/or
# modify it under the terms of version 2.1 of the GNU Lesser General Public
# License as published by the Free Software Foundation.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
#============================================================================
# Copyright (C) 2006 Anthony Liguori <aliguori@us.ibm.com>
# Copyright (C) 2006 XenSource Inc.
#============================================================================

"""
XML-RPC SSH transport.
"""

from xmlrpclib import getparser, Fault
from subprocess import Popen, PIPE
from getpass import getuser
from fcntl import ioctl
import errno
import os
import termios


def getHTTPURI(uri):
    (protocol, rest) = uri.split(':', 1)
    if not rest.startswith('//'):
        raise ValueError("Invalid ssh URL '%s'" % uri)
    rest = rest[2:]
    user = getuser()
    path = 'RPC2'
    if rest.find('@') != -1:
        (user, rest) = rest.split('@', 1)
    if rest.find('/') != -1:
        (host, rest) = rest.split('/', 1)
        if len(rest) > 0:
            path = rest
    else:
        host = rest
    transport = SSHTransport(host, user)
    uri = 'http://%s/%s' % (host, path)
    return transport, uri


class SSHTransport(object):
    def __init__(self, host, user, askpass=None):
        self.host = host
        self.user = user
        self.askpass = askpass
        self.ssh = None

    def getssh(self):
        if self.ssh == None:
            if self.askpass:
                f = open('/dev/tty', 'w')
                try:
                    os.environ['SSH_ASKPASS'] = self.askpass
                    ioctl(f.fileno(), termios.TIOCNOTTY)
                finally:
                    f.close()

            cmd = ['ssh', '%s@%s' % (self.user, self.host), 'xm serve']
            try:
                self.ssh = Popen(cmd, bufsize=0, stdin=PIPE, stdout=PIPE)
            except OSError, (err, msg):
                if err == errno.ENOENT:
                    raise Fault(0, "ssh executable not found!")
                raise
        return self.ssh

    def request(self, host, handler, request_body, verbose=0):
        p, u = getparser()
        ssh = self.getssh()
        ssh.stdin.write("""POST /%s HTTP/1.1
User-Agent: Xen
Host: %s
Content-Type: text/xml
Content-Length: %d

%s""" % (handler, host, len(request_body), request_body))
        ssh.stdin.flush()

        content_length = 0
        line = ssh.stdout.readline()
        if line.split()[1] != '200':
            raise Fault(0, 'Server returned %s' % (' '.join(line[1:])))
        
        while line not in ['', '\r\n', '\n']:
            if line.lower().startswith('content-length:'):
                content_length = int(line[15:].strip())
            line = ssh.stdout.readline()
        content = ssh.stdout.read(content_length)
        p.feed(content)
        p.close()
        return u.close()