Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(7)

Unified Diff: tools/vim/tests/chromium.ycm_extra_conf_unittest.py

Issue 2039923002: Fix the .ycm_extra_conf.py and SublimeText documentation. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Reverted a forgotten debug hack. Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/vim/chromium.ycm_extra_conf.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/vim/tests/chromium.ycm_extra_conf_unittest.py
diff --git a/tools/vim/tests/chromium.ycm_extra_conf_unittest.py b/tools/vim/tests/chromium.ycm_extra_conf_unittest.py
index b9a1ff4b7996ba3b446369b0dee0cda2cf7191be..bb3dca421b8c3a05a66e9ae62d2d971ddc1a8e36 100755
--- a/tools/vim/tests/chromium.ycm_extra_conf_unittest.py
+++ b/tools/vim/tests/chromium.ycm_extra_conf_unittest.py
@@ -53,15 +53,6 @@ def CreateFile(path,
statinfo = os.stat(path)
os.chmod(path, statinfo.st_mode | stat.S_IXUSR)
-@unittest.skipIf(sys.platform.startswith('linux'),
- 'Tests are only valid on Linux.')
-class Chromium_ycmExtraConfTest_NotOnLinux(unittest.TestCase):
- def testAlwaysFailsIfNotRunningOnLinux(self):
- self.fail('Changes to chromium.ycm_extra_conf.py currently need to be ' \
- 'uploaded from Linux since the tests only run on Linux.')
-
-@unittest.skipUnless(sys.platform.startswith('linux'),
- 'Tests are only valid on Linux.')
class Chromium_ycmExtraConfTest(unittest.TestCase):
def SetUpFakeChromeTreeBelowPath(self):
@@ -104,7 +95,7 @@ class Chromium_ycmExtraConfTest(unittest.TestCase):
def NormalizeString(self, string):
return string.replace(self.out_dir, '[OUT]').\
- replace(self.chrome_root, '[SRC]')
+ replace(self.chrome_root, '[SRC]').replace('\\', '/')
def NormalizeStringsInList(self, list_of_strings):
return [self.NormalizeString(s) for s in list_of_strings]
@@ -172,8 +163,10 @@ class Chromium_ycmExtraConfTest(unittest.TestCase):
clang_options = \
self.ycm_extra_conf.GetClangOptionsFromNinjaForFilename(
self.chrome_root, os.path.join(self.chrome_root, 'one.cpp'))
- self.assertIn('-I%s/a' % out_dir, clang_options)
- self.assertIn('-I%s/tag-one' % out_dir, clang_options)
+ self.assertIn('-I%s/a' % self.NormalizeString(out_dir),
+ self.NormalizeStringsInList(clang_options))
+ self.assertIn('-I%s/tag-one' % self.NormalizeString(out_dir),
+ self.NormalizeStringsInList(clang_options))
def testGetFlagsForFileForKnownCppFile(self):
result = self.ycm_extra_conf.FlagsForFile(
@@ -313,7 +306,8 @@ class Chromium_ycmExtraConfTest(unittest.TestCase):
# output.
p = subprocess.Popen(['ninja', '-C', self.out_dir, '-t',
'query', '../../four.cc'],
- stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
+ stdout=subprocess.PIPE, stderr=subprocess.STDOUT,
+ universal_newlines=True)
stdout, _ = p.communicate()
self.assertFalse(p.returncode)
self.assertEquals(stdout,
« no previous file with comments | « tools/vim/chromium.ycm_extra_conf.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698