Sha256: 12036a07b800538386a33ab5f55989923823666c8864bb3d5a696adaabe6f919

Contents?: true

Size: 1.74 KB

Versions: 48

Compression:

Stored size: 1.74 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):
  def test_BinaryNamesWindows(self):
    # These cannot run on non-Windows as they require a VS installation to
    # correctly handle variable expansion.
    if sys.platform.startswith('win'):
      writer = ninja.NinjaWriter('foo', 'wee', '.', '.', 'build.ninja', '.',
          'build.ninja', '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'))

  def test_BinaryNamesLinux(self):
    writer = ninja.NinjaWriter('foo', 'wee', '.', '.', 'build.ninja', '.',
        'build.ninja', '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

48 entries across 41 versions & 17 rubygems

Version Path
optimacms-0.1.61 spec/dummy/node_modules/node-gyp/gyp/pylib/gyp/generator/ninja_test.py
disco_app-0.18.0 test/dummy/node_modules/node-gyp/gyp/pylib/gyp/generator/ninja_test.py
disco_app-0.18.2 test/dummy/node_modules/node-gyp/gyp/pylib/gyp/generator/ninja_test.py
tang-0.2.1 spec/tang_app/node_modules/node-gyp/gyp/pylib/gyp/generator/ninja_test.py
groonga-client-model-6.0.0 test/apps/rails6.1.3/node_modules/node-gyp/gyp/pylib/gyp/generator/ninja_test.py
groonga-client-model-6.0.0 test/apps/rails6.0.3.5/node_modules/node-gyp/gyp/pylib/gyp/generator/ninja_test.py
ruby2js-4.0.4 lib/tasks/testrails/node_modules/node-gyp/gyp/pylib/gyp/generator/ninja_test.py
ruby2js-4.0.3 lib/tasks/testrails/node_modules/node-gyp/gyp/pylib/gyp/generator/ninja_test.py
tang-0.2.0 spec/tang_app/node_modules/node-gyp/gyp/pylib/gyp/generator/ninja_test.py
tang-0.1.0 spec/tang_app/node_modules/node-gyp/gyp/pylib/gyp/generator/ninja_test.py
tang-0.0.9 spec/tang_app/node_modules/node-gyp/gyp/pylib/gyp/generator/ninja_test.py
enju_library-0.3.8 spec/dummy/node_modules/node-gyp/gyp/pylib/gyp/generator/ninja_test.py
ilog-0.4.1 node_modules/node-gyp/gyp/pylib/gyp/generator/ninja_test.py
ilog-0.4.0 node_modules/node-gyp/gyp/pylib/gyp/generator/ninja_test.py
ilog-0.3.3 node_modules/node-gyp/gyp/pylib/gyp/generator/ninja_test.py
jester-data-8.0.0 node_modules/node-gyp/gyp/pylib/gyp/generator/ninja_test.py
ezii-os-5.2.1 node_modules/node-gyp/gyp/pylib/gyp/generator/ninja_test.py
ezii-os-2.0.1 node_modules/node-gyp/gyp/pylib/gyp/generator/ninja_test.py
ezii-os-1.1.0 node_modules/node-gyp/gyp/pylib/gyp/generator/ninja_test.py
ezii-os-1.0.0 node_modules/node-gyp/gyp/pylib/gyp/generator/ninja_test.py