Sha256: a8e625696b9aec8d7caa7ae7cbe106212f6ba41c311980c1734b7bc4714b8e4a

Contents?: true

Size: 1.63 KB

Versions: 23

Compression:

Stored size: 1.63 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('foo', '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('foo', '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

23 entries across 23 versions & 3 rubygems

Version Path
libv8-3.16.14.19.1 vendor/gyp/pylib/gyp/generator/ninja_test.py
libv8-3.16.14.19 vendor/gyp/pylib/gyp/generator/ninja_test.py
libv8-3.16.14.18 vendor/gyp/pylib/gyp/generator/ninja_test.py
arcabouco-0.2.13 vendor/bundle/gems/libv8-3.16.14.17/vendor/gyp/pylib/gyp/generator/ninja_test.py
libv8-3.16.14.17 vendor/gyp/pylib/gyp/generator/ninja_test.py
libv8-3.16.14.16 vendor/gyp/pylib/gyp/generator/ninja_test.py
libv8-3.16.14.15 vendor/gyp/pylib/gyp/generator/ninja_test.py
libv8-3.16.14.14 vendor/gyp/pylib/gyp/generator/ninja_test.py
libv8-tmpfork-3.16.14.13 vendor/gyp/pylib/gyp/generator/ninja_test.py
libv8-3.16.14.13 vendor/gyp/pylib/gyp/generator/ninja_test.py
libv8-3.16.14.12 vendor/gyp/pylib/gyp/generator/ninja_test.py
libv8-3.16.14.11 vendor/gyp/pylib/gyp/generator/ninja_test.py
libv8-3.16.14.10 vendor/gyp/pylib/gyp/generator/ninja_test.py
libv8-3.16.14.8 vendor/gyp/pylib/gyp/generator/ninja_test.py
libv8-3.16.14.8.rc1 vendor/gyp/pylib/gyp/generator/ninja_test.py
libv8-3.16.14.7 vendor/gyp/pylib/gyp/generator/ninja_test.py
libv8-3.16.14.6 vendor/gyp/pylib/gyp/generator/ninja_test.py
libv8-3.16.14.5 vendor/gyp/pylib/gyp/generator/ninja_test.py
libv8-3.16.14.4 vendor/gyp/pylib/gyp/generator/ninja_test.py
libv8-3.16.14.3 vendor/gyp/pylib/gyp/generator/ninja_test.py