29 """Shared utilities for writing scripts for Google Test/Mock.""" 31 __author__ =
'wan@google.com (Zhanyong Wan)' 43 _SVN_INFO_URL_RE = re.compile(
r'^URL: https://(\w+)\.googlecode\.com/svn(.*)')
47 """Runs the shell command and returns its stdout as a list of lines.""" 49 f = os.popen(command,
'r') 50 lines = [line.strip() for line
in f.readlines()]
56 """Returns the project name and the current SVN workspace's root path.""" 59 m = _SVN_INFO_URL_RE.match(line)
63 root = os.path.realpath(rel_path.count(
'/') *
'../')
70 """Returns the current SVN workspace's trunk root path.""" 73 return root +
'/trunk' if root
else None 78 return project ==
'googletest' 83 return project ==
'googlemock'
def GetCommandOutput(command)