#!/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 sys 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()
Name | Type | Size | Permission | Actions |
---|---|---|---|---|
__pycache__ | Folder | 0755 |
|
|
__init__.py | File | 0 B | 0644 |
|
__init__.pyc | File | 178 B | 0644 |
|
analyzer.py | File | 29.91 KB | 0644 |
|
android.py | File | 44.3 KB | 0644 |
|
cmake.py | File | 43.69 KB | 0644 |
|
compile_commands_json.py | File | 4.17 KB | 0644 |
|
dump_dependency_json.py | File | 3.38 KB | 0644 |
|
eclipse.py | File | 16.72 KB | 0644 |
|
gypd.py | File | 3.39 KB | 0644 |
|
gypsh.py | File | 1.63 KB | 0644 |
|
make.py | File | 90.86 KB | 0644 |
|
make.pyc | File | 70.2 KB | 0644 |
|
msvs.py | File | 130.51 KB | 0644 |
|
msvs_test.py | File | 1.05 KB | 0755 |
|
ninja.py | File | 98.42 KB | 0644 |
|
ninja.pyc | File | 67.59 KB | 0644 |
|
ninja_test.py | File | 1.71 KB | 0644 |
|
xcode.py | File | 56.99 KB | 0644 |
|
xcode.pyc | File | 25.75 KB | 0644 |
|
xcode_test.py | File | 645 B | 0644 |
|