Sha256: 60a86add0799d5bf4d92dd1d25e2c1610d075f5131a71167171a7e11a4120a44

Contents?: true

Size: 1.62 KB

Versions: 16

Compression:

Stored size: 1.62 KB

Contents

#!/usr/bin/env python

# Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

""" Unit tests for the ninja.py file. """

import gyp.generator.ninja as ninja
import unittest
import StringIO
import sys
import TestCommon


class TestPrefixesAndSuffixes(unittest.TestCase):
  if sys.platform in ('win32', 'cygwin'):
    def test_BinaryNamesWindows(self):
      writer = ninja.NinjaWriter('wee', '.', '.', 'ninja.build', 'win')
      spec = { 'target_name': 'wee' }
      self.assertTrue(writer.ComputeOutputFileName(spec, 'executable').
          endswith('.exe'))
      self.assertTrue(writer.ComputeOutputFileName(spec, 'shared_library').
          endswith('.dll'))
      self.assertTrue(writer.ComputeOutputFileName(spec, 'static_library').
          endswith('.lib'))

  if sys.platform == 'linux2':
    def test_BinaryNamesLinux(self):
      writer = ninja.NinjaWriter('wee', '.', '.', 'ninja.build', 'linux')
      spec = { 'target_name': 'wee' }
      self.assertTrue('.' not in writer.ComputeOutputFileName(spec,
                                                              'executable'))
      self.assertTrue(writer.ComputeOutputFileName(spec, 'shared_library').
          startswith('lib'))
      self.assertTrue(writer.ComputeOutputFileName(spec, 'static_library').
          startswith('lib'))
      self.assertTrue(writer.ComputeOutputFileName(spec, 'shared_library').
          endswith('.so'))
      self.assertTrue(writer.ComputeOutputFileName(spec, 'static_library').
          endswith('.a'))

if __name__ == '__main__':
  unittest.main()

Version data entries

16 entries across 16 versions & 3 rubygems

Version Path
libv8-3.11.8.17 vendor/v8/build/gyp/pylib/gyp/generator/ninja_test.py
libv8-3.11.8.16 vendor/v8/build/gyp/pylib/gyp/generator/ninja_test.py
libv8-3.11.8.13 vendor/v8/build/gyp/pylib/gyp/generator/ninja_test.py
libv8-3.11.8.12 vendor/v8/build/gyp/pylib/gyp/generator/ninja_test.py
sunrise-cms-0.5.0.rc1 vendor/bundle/ruby/1.9.1/gems/libv8-3.11.8.4/vendor/v8/build/gyp/pylib/gyp/generator/ninja_test.py
libv8-3.11.8.11 vendor/v8/build/gyp/pylib/gyp/generator/ninja_test.py
libv8-3.11.8.10 vendor/v8/build/gyp/pylib/gyp/generator/ninja_test.py
libv8-3.11.8.9 vendor/v8/build/gyp/pylib/gyp/generator/ninja_test.py
libv8-3.11.8.8 vendor/v8/build/gyp/pylib/gyp/generator/ninja_test.py
libv8-3.11.8.7 vendor/v8/build/gyp/pylib/gyp/generator/ninja_test.py
libv8-3.11.8.4 vendor/v8/build/gyp/pylib/gyp/generator/ninja_test.py
libv8-freebsd-3.11.8.3 vendor/v8/build/gyp/pylib/gyp/generator/ninja_test.py
libv8-3.11.8.3 vendor/v8/build/gyp/pylib/gyp/generator/ninja_test.py
libv8-3.11.8.1 vendor/v8/build/gyp/pylib/gyp/generator/ninja_test.py
libv8-3.11.8.0 vendor/v8/build/gyp/pylib/gyp/generator/ninja_test.py
libv8-3.10.8.0 vendor/v8/build/gyp/pylib/gyp/generator/ninja_test.py