gpu/command_buffer/build_cmd_buffer_lib.py
def WriteServiceUnitTests(self, filename_pattern):
    """Writes the service decoder unit tests."""
    num_tests = len(self.functions)
    FUNCTIONS_PER_FILE = 98  # hard code this so it doesn't change.
    count = 0
    for test_num in range(0, num_tests, FUNCTIONS_PER_FILE):
      count += 1
      filename = filename_pattern % count
      comment = "// It is included by %s_cmd_decoder_unittest_%d.cc\n" \
                % (_lower_prefix, count)
      with CHeaderWriter(filename, self.year, comment) as f:
        end = test_num + FUNCTIONS_PER_FILE
        if end > num_tests:
          end = num_tests
        for idx in range(test_num, end):
          func = self.functions[idx]
          test_name = '%sDecoderTest%d' % (_prefix, count)
          if func.IsES3():
            test_name = 'GLES3DecoderTest%d' % count

          # Do any filtering of the functions here, so that the functions
          # will not move between the numbered files if filtering properties
          # are changed.
          if func.GetInfo('extension_flag'):
            continue

          if func.GetInfo('unit_test') != False:
            func.WriteServiceUnitTest(f, {
              'test_name': test_name
            })
      self.generated_cpp_filenames.append(filename)
Writes the service decoder unit tests.
Writes the service decoder unit tests.
Writes the service decoder unit tests .
def WriteServiceUnitTests(self, filename_pattern):
    num_tests = len(self.functions)
    FUNCTIONS_PER_FILE = 98  
    count = 0
    for test_num in range(0, num_tests, FUNCTIONS_PER_FILE):
      count += 1
      filename = filename_pattern % count
      comment = "// It is included by %s_cmd_decoder_unittest_%d.cc\n" \
                % (_lower_prefix, count)
      with CHeaderWriter(filename, self.year, comment) as f:
        end = test_num + FUNCTIONS_PER_FILE
        if end > num_tests:
          end = num_tests
        for idx in range(test_num, end):
          func = self.functions[idx]
          test_name = '%sDecoderTest%d' % (_prefix, count)
          if func.IsES3():
            test_name = 'GLES3DecoderTest%d' % count
          if func.GetInfo('extension_flag'):
            continue
          if func.GetInfo('unit_test') != False:
            func.WriteServiceUnitTest(f, {
              'test_name': test_name
            })
      self.generated_cpp_filenames.append(filename)
def WriteServiceUnitTests ( self , filename_pattern ) : num_tests = len ( self . functions ) FUNCTIONS_PER_FILE = 98 count = 0 for test_num in range ( 0 , num_tests , FUNCTIONS_PER_FILE ) : count += 1 filename = filename_pattern % count comment = "// It is included by %s_cmd_decoder_unittest_%d.cc\n" % ( _lower_prefix , count ) with CHeaderWriter ( filename , self . year , comment ) as f : end = test_num + FUNCTIONS_PER_FILE if end > num_tests : end = num_tests for idx in range ( test_num , end ) : func = self . functions [ idx ] test_name = '%sDecoderTest%d' % ( _prefix , count ) if func . IsES3 ( ) : test_name = 'GLES3DecoderTest%d' % count if func . GetInfo ( 'extension_flag' ) : continue if func . GetInfo ( 'unit_test' ) != False : func . WriteServiceUnitTest ( f , { 'test_name' : test_name } ) self . generated_cpp_filenames . append ( filename )
Writes the service decoder unit tests.
Writes the service decoder unit tests .
"""Writes the service decoder unit tests.""" # hard code this so it doesn't change. # Do any filtering of the functions here, so that the functions # will not move between the numbered files if filtering properties # are changed.
self
filename_pattern