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

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

Issue 9420031: Retrieve generator variables and use those for prefix/suffix, rather than repeating (Closed) Base URL: http://gyp.googlecode.com/svn/trunk/
Patch Set: Created 8 years, 10 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 | Annotate | Revision Log
« no previous file with comments | « pylib/gyp/generator/ninja.py ('k') | test/small/gyptest-small.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Property Changes:
Added: svn:eol-style
+ LF
OLDNEW
(Empty)
1 #!/usr/bin/env python
2
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
5 # found in the LICENSE file.
6
7 """ Unit tests for the ninja.py file. """
8
9 import gyp.generator.ninja as ninja
10 import unittest
11 import StringIO
12 import TestCommon
13
14
Nico 2012/02/16 23:40:18 FWIW, I think system tests are better to explain _
15 class TestPrefixesAndSuffixes(unittest.TestCase):
16 def test_BinaryNamesWindows(self):
17 writer = ninja.NinjaWriter('wee', '.', '.', 'ninja.build', 'win')
18 spec = { 'target_name': 'wee' }
19 self.assertTrue(writer.ComputeOutputFileName(spec, 'executable').
20 endswith('.exe'))
21 self.assertTrue(writer.ComputeOutputFileName(spec, 'shared_library').
22 endswith('.dll'))
23 self.assertTrue(writer.ComputeOutputFileName(spec, 'static_library').
24 endswith('.lib'))
25
26 def test_BinaryNamesLinux(self):
27 writer = ninja.NinjaWriter('wee', '.', '.', 'ninja.build', 'linux')
28 spec = {
29 'target_name': 'wee'
30 }
31 self.assertTrue('.' not in writer.ComputeOutputFileName(spec, 'executable'))
32 self.assertTrue(writer.ComputeOutputFileName(spec, 'shared_library').
33 startswith('lib'))
34 self.assertTrue(writer.ComputeOutputFileName(spec, 'static_library').
35 startswith('lib'))
36 self.assertTrue(writer.ComputeOutputFileName(spec, 'shared_library').
37 endswith('.so'))
38 self.assertTrue(writer.ComputeOutputFileName(spec, 'static_library').
39 endswith('.a'))
40
41 if __name__ == '__main__':
42 unittest.main()
OLDNEW
« no previous file with comments | « pylib/gyp/generator/ninja.py ('k') | test/small/gyptest-small.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698