Commit 97170130 authored by maruel@chromium.org's avatar maruel@chromium.org

Fix many (but not all[1]) depot_tools tests on Windows.

[1] *scm_test.py are deeply broken, svnadmin is missing for svn_bin\.
And the git test are failing at shutdown.

Also Fix SvnCheckout.testMove flakiness.

TBR=ilevy@chromium.org,szager@chromium.org
BUG=

Review URL: https://chromiumcodereview.appspot.com/14729012

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@198900 0039d316-1c4b-4281-b951-d872f2087c98
parent be31c43f
......@@ -401,9 +401,12 @@ class SvnCheckout(SvnBaseTest):
self._check_move(co)
out = subprocess2.check_output(
['svn', 'status'], cwd=co.project_path)
expected = (
'A + chromeos/views/webui_menu_widget.h\n'
'D chromeos/views/DOMui_menu_widget.h\n')
out = sorted(out.splitlines())
expected = sorted(
[
'A + chromeos/views/webui_menu_widget.h',
'D chromeos/views/DOMui_menu_widget.h',
])
self.assertEquals(expected, out)
# Make sure ancestry is what is expected;
env = os.environ.copy()
......
......@@ -1064,7 +1064,7 @@ class ManagedGitWrapperTestCaseMox(BaseTestCase):
self.fake_hash_1 = 't0ta11yf4k3'
self.fake_hash_2 = '3v3nf4k3r'
self.url = 'git://foo'
self.root_dir = '/tmp'
self.root_dir = '/tmp' if sys.platform != 'win32' else 't:\\tmp'
self.relpath = 'fake'
self.base_path = os.path.join(self.root_dir, self.relpath)
......
......@@ -952,9 +952,9 @@ class InputApiUnittest(PresubmitTestsBase):
['M', join('foo', 'blat', 'weird.xyz')],
['M', join('foo', 'blat', 'another.h')],
['M', join('foo', 'third_party', 'third.cc')],
['D', 'foo/mat/beingdeleted.txt'],
['M', 'flop/notfound.txt'],
['A', 'boo/flap.h'],
['D', join('foo', 'mat', 'beingdeleted.txt')],
['M', join('flop', 'notfound.txt')],
['A', join('boo', 'flap.h')],
]
blat = presubmit.normpath(join(self.fake_root_dir, files[0][1]))
readme = presubmit.normpath(join(self.fake_root_dir, files[1][1]))
......
......@@ -13,7 +13,7 @@ import time
import unittest
try:
import fcntl
import fcntl # pylint: disable=F0401
except ImportError:
fcntl = None
......@@ -329,8 +329,10 @@ class RegressionTest(BaseTestCase):
def test_stderr(self):
cmd = ['expr', '1', '/', '0']
p1 = subprocess.Popen(cmd, stderr=subprocess.PIPE)
p2 = subprocess2.Popen(cmd, stderr=subprocess.PIPE)
if sys.platform == 'win32':
cmd = ['cmd.exe', '/c', 'exit', '1']
p1 = subprocess.Popen(cmd, stderr=subprocess.PIPE, shell=False)
p2 = subprocess2.Popen(cmd, stderr=subprocess.PIPE, shell=False)
r1 = p1.communicate()
r2 = p2.communicate(timeout=100)
self.assertEquals(r1, r2)
......@@ -431,7 +433,8 @@ class S2Test(BaseTestCase):
stdin=VOID,
stdout=PIPE,
timeout=10,
universal_newlines=un)
universal_newlines=un,
shell=False)
self._check_res(res, c('A\nBB\nCCC\n'), None, 0)
self._run_test(fn)
......@@ -576,7 +579,9 @@ class S2Test(BaseTestCase):
res = subprocess2.communicate(
self.exe + ['--large', '--read'], stdin=stdin, stdout=stdout.append)
self.assertEquals(128*1024, len(''.join(stdout)))
self._check_res(res, None, None, 0)
# Windows return code is > 8 bits.
returncode = len(stdin) if sys.platform == 'win32' else 0
self._check_res(res, None, None, returncode)
def test_tee_cb_throw(self):
# Having a callback throwing up should not cause side-effects. It's a bit
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment