Example #1
0
 def test_write_group_empty(self):
   f = tempfile.TemporaryFile()
   assert f.tell() == 0
   for empty in (None, []):
     for truth in (True, False):
       makefile_writer.write_group(f, 'name', empty, truth)
       self.assertEqual(f.tell(), 0)
   f.close()
 def test_write_group_empty(self):
     f = tempfile.TemporaryFile()
     assert f.tell() == 0
     for empty in (None, []):
         for truth in (True, False):
             makefile_writer.write_group(f, 'name', empty, truth)
             self.assertEqual(f.tell(), 0)
     f.close()
Example #3
0
  def test_write_group(self):
    animals = ('dog', 'cat', 'mouse', 'elephant')
    fd, filename = tempfile.mkstemp()
    with open(filename, 'w') as f:
      makefile_writer.write_group(f, 'animals', animals, False)
    os.close(fd)
    # Now confirm that it matches expectations
    self.__compare_files(filename, 'animals.txt')

    with open(filename, 'w') as f:
      makefile_writer.write_group(f, 'animals_append', animals, True)
    # Now confirm that it matches expectations
    self.__compare_files(filename, 'animals_append.txt')
    os.remove(filename)
    def test_write_group(self):
        animals = ('dog', 'cat', 'mouse', 'elephant')
        fd, filename = tempfile.mkstemp()
        with open(filename, 'w') as f:
            makefile_writer.write_group(f, 'animals', animals, False)
        os.close(fd)
        # Now confirm that it matches expectations
        utils.compare_to_expectation(filename, 'animals.txt', self.assertTrue)

        with open(filename, 'w') as f:
            makefile_writer.write_group(f, 'animals_append', animals, True)
        # Now confirm that it matches expectations
        utils.compare_to_expectation(filename, 'animals_append.txt',
                                     self.assertTrue)
        os.remove(filename)
Example #5
0
def write_tool_android_mk(target_dir, var_dict):
  """Write Android.mk for a Skia tool.

  Args:
    target_dir: Destination for the makefile. Must not be None.
    var_dict: VarsDict containing variables for the makefile.
  """
  target_file = os.path.join(target_dir, 'Android.mk')
  with open(target_file, 'w') as f:
    f.write(makefile_writer.AUTOGEN_WARNING)

    makefile_writer.write_local_path(f)
    makefile_writer.write_clear_vars(f)

    makefile_writer.write_local_vars(f, var_dict, False, None)

    makefile_writer.write_group(f, 'LOCAL_PICKUP_FILES',
                                ['$(LOCAL_PATH)/../resources'], False)

    f.write('include $(BUILD_NATIVE_TEST)\n')
def write_tool_android_mk(target_dir, var_dict):
    """Write Android.mk for a Skia tool.

  Args:
    target_dir: Destination for the makefile. Must not be None.
    var_dict: VarsDict containing variables for the makefile.
  """
    target_file = os.path.join(target_dir, 'Android.mk')
    with open(target_file, 'w') as f:
        f.write(makefile_writer.AUTOGEN_WARNING)

        makefile_writer.write_local_path(f)
        makefile_writer.write_clear_vars(f)

        makefile_writer.write_local_vars(f, var_dict, False, None)

        makefile_writer.write_group(f, 'LOCAL_PICKUP_FILES',
                                    ['$(LOCAL_PATH)/../resources'], False)

        f.write('include $(BUILD_NATIVE_TEST)\n')