Пример #1
0
 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'))
Пример #2
0
 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'))
Пример #3
0
 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'))
Пример #4
0
 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"))
Пример #5
0
 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"))