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

Side by Side Diff: pylib/gyp/generator/ninja_test.py

Issue 1454433002: Python 3 compatibility Base URL: https://chromium.googlesource.com/external/gyp.git@master
Patch Set: Rebase with master (4ec6c4e3a94bd04a6da2858163d40b2429b8aad1) Created 4 years, 8 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 unified diff | Download patch
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 2
3 # Copyright (c) 2012 Google Inc. All rights reserved. 3 # Copyright (c) 2012 Google Inc. All rights reserved.
4 # Use of this source code is governed by a BSD-style license that can be 4 # Use of this source code is governed by a BSD-style license that can be
5 # found in the LICENSE file. 5 # found in the LICENSE file.
6 6
7 """ Unit tests for the ninja.py file. """ 7 """ Unit tests for the ninja.py file. """
8 8
9 import gyp.generator.ninja as ninja 9 import gyp.generator.ninja as ninja
10 import unittest 10 import unittest
11 import StringIO
12 import sys 11 import sys
13 import TestCommon 12 import TestCommon
14 13
15 14
16 class TestPrefixesAndSuffixes(unittest.TestCase): 15 class TestPrefixesAndSuffixes(unittest.TestCase):
17 def test_BinaryNamesWindows(self): 16 def test_BinaryNamesWindows(self):
18 # These cannot run on non-Windows as they require a VS installation to 17 # These cannot run on non-Windows as they require a VS installation to
19 # correctly handle variable expansion. 18 # correctly handle variable expansion.
20 if sys.platform.startswith('win'): 19 if sys.platform.startswith('win'):
21 writer = ninja.NinjaWriter('foo', 'wee', '.', '.', 'build.ninja', '.', 20 writer = ninja.NinjaWriter('foo', 'wee', '.', '.', 'build.ninja', '.',
(...skipping 16 matching lines...) Expand all
38 startswith('lib')) 37 startswith('lib'))
39 self.assertTrue(writer.ComputeOutputFileName(spec, 'static_library'). 38 self.assertTrue(writer.ComputeOutputFileName(spec, 'static_library').
40 startswith('lib')) 39 startswith('lib'))
41 self.assertTrue(writer.ComputeOutputFileName(spec, 'shared_library'). 40 self.assertTrue(writer.ComputeOutputFileName(spec, 'shared_library').
42 endswith('.so')) 41 endswith('.so'))
43 self.assertTrue(writer.ComputeOutputFileName(spec, 'static_library'). 42 self.assertTrue(writer.ComputeOutputFileName(spec, 'static_library').
44 endswith('.a')) 43 endswith('.a'))
45 44
46 if __name__ == '__main__': 45 if __name__ == '__main__':
47 unittest.main() 46 unittest.main()
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698