native_client_sdk/src/tools/tests/create_nmf_test.py
def testDynamicWithRelPath(self):
    """Test that when the nmf root is a relative path that things work."""
    old_path = os.getcwd()
    try:
      os.chdir(self.tempdir)
      nmf, nexes = self._CreateDynamicAndStageDeps(self.arch_dir, nmf_root='')
      expected_manifest = {
        'files': {
          'main.nexe': {
            'arm': {'url': 'arm/test_dynamic_arm.nexe'},
            'x86-32': {'url': 'x86_32/test_dynamic_x86_32.nexe'},
            'x86-64': {'url': 'x86_64/test_dynamic_x86_64.nexe'},
          },
          'ld-nacl-arm.so.1': {
            'arm': {'url': 'arm/libarm/ld-nacl-arm.so.1'},
          },
          'libc.so.0.1': {
            'arm': {'url': 'arm/libarm/libc.so.0.1'}
          },
          'libc.so': {
            'x86-32': {'url': 'x86_32/lib32/libc.so'},
            'x86-64': {'url': 'x86_64/lib64/libc.so'},
          },
          'libgcc_s.so.1': {
            'arm': {'url': 'arm/libarm/libgcc_s.so.1'},
            'x86-32': {'url': 'x86_32/lib32/libgcc_s.so.1'},
            'x86-64': {'url': 'x86_64/lib64/libgcc_s.so.1'},
          },
          'libpthread.so.0': {
            'arm': { 'url': 'arm/libarm/libpthread.so.0'}
          },
          'libpthread.so': {
            'x86-32': {'url': 'x86_32/lib32/libpthread.so'},
            'x86-64': {'url': 'x86_64/lib64/libpthread.so'},
          },
        },
        'program': {
          'arm': {'url': 'arm/libarm/elf_loader_arm.nexe'},
          'x86-32': {'url': 'x86_32/lib32/runnable-ld.so'},
          'x86-64': {'url': 'x86_64/lib64/runnable-ld.so'},
        }
      }

      expected_staging = [PosixRelPath(f, self.tempdir) for f in nexes]
      expected_staging.extend([
        'x86_32/lib32/libc.so',
        'x86_32/lib32/libgcc_s.so.1',
        'x86_32/lib32/libpthread.so',
        'x86_32/lib32/runnable-ld.so',
        'x86_64/lib64/libc.so',
        'x86_64/lib64/libgcc_s.so.1',
        'x86_64/lib64/libpthread.so',
        'x86_64/lib64/runnable-ld.so',
        'arm/libarm/elf_loader_arm.nexe',
        'arm/libarm/libpthread.so.0',
        'arm/libarm/ld-nacl-arm.so.1',
        'arm/libarm/libgcc_s.so.1',
        'arm/libarm/libc.so.0.1'
      ])

      self.assertManifestEquals(nmf, expected_manifest)
      self.assertStagingEquals(expected_staging)
    finally:
      os.chdir(old_path)
Test that when the nmf root is a relative path that things work.
Test that when the nmf root is a relative path that things work.
Test that when the nmf root is a relative path that things work .
def testDynamicWithRelPath(self):
    old_path = os.getcwd()
    try:
      os.chdir(self.tempdir)
      nmf, nexes = self._CreateDynamicAndStageDeps(self.arch_dir, nmf_root='')
      expected_manifest = {
        'files': {
          'main.nexe': {
            'arm': {'url': 'arm/test_dynamic_arm.nexe'},
            'x86-32': {'url': 'x86_32/test_dynamic_x86_32.nexe'},
            'x86-64': {'url': 'x86_64/test_dynamic_x86_64.nexe'},
          },
          'ld-nacl-arm.so.1': {
            'arm': {'url': 'arm/libarm/ld-nacl-arm.so.1'},
          },
          'libc.so.0.1': {
            'arm': {'url': 'arm/libarm/libc.so.0.1'}
          },
          'libc.so': {
            'x86-32': {'url': 'x86_32/lib32/libc.so'},
            'x86-64': {'url': 'x86_64/lib64/libc.so'},
          },
          'libgcc_s.so.1': {
            'arm': {'url': 'arm/libarm/libgcc_s.so.1'},
            'x86-32': {'url': 'x86_32/lib32/libgcc_s.so.1'},
            'x86-64': {'url': 'x86_64/lib64/libgcc_s.so.1'},
          },
          'libpthread.so.0': {
            'arm': { 'url': 'arm/libarm/libpthread.so.0'}
          },
          'libpthread.so': {
            'x86-32': {'url': 'x86_32/lib32/libpthread.so'},
            'x86-64': {'url': 'x86_64/lib64/libpthread.so'},
          },
        },
        'program': {
          'arm': {'url': 'arm/libarm/elf_loader_arm.nexe'},
          'x86-32': {'url': 'x86_32/lib32/runnable-ld.so'},
          'x86-64': {'url': 'x86_64/lib64/runnable-ld.so'},
        }
      }
      expected_staging = [PosixRelPath(f, self.tempdir) for f in nexes]
      expected_staging.extend([
        'x86_32/lib32/libc.so',
        'x86_32/lib32/libgcc_s.so.1',
        'x86_32/lib32/libpthread.so',
        'x86_32/lib32/runnable-ld.so',
        'x86_64/lib64/libc.so',
        'x86_64/lib64/libgcc_s.so.1',
        'x86_64/lib64/libpthread.so',
        'x86_64/lib64/runnable-ld.so',
        'arm/libarm/elf_loader_arm.nexe',
        'arm/libarm/libpthread.so.0',
        'arm/libarm/ld-nacl-arm.so.1',
        'arm/libarm/libgcc_s.so.1',
        'arm/libarm/libc.so.0.1'
      ])
      self.assertManifestEquals(nmf, expected_manifest)
      self.assertStagingEquals(expected_staging)
    finally:
      os.chdir(old_path)
def testDynamicWithRelPath ( self ) : old_path = os . getcwd ( ) try : os . chdir ( self . tempdir ) nmf , nexes = self . _CreateDynamicAndStageDeps ( self . arch_dir , nmf_root = '' ) expected_manifest = { 'files' : { 'main.nexe' : { 'arm' : { 'url' : 'arm/test_dynamic_arm.nexe' } , 'x86-32' : { 'url' : 'x86_32/test_dynamic_x86_32.nexe' } , 'x86-64' : { 'url' : 'x86_64/test_dynamic_x86_64.nexe' } , } , 'ld-nacl-arm.so.1' : { 'arm' : { 'url' : 'arm/libarm/ld-nacl-arm.so.1' } , } , 'libc.so.0.1' : { 'arm' : { 'url' : 'arm/libarm/libc.so.0.1' } } , 'libc.so' : { 'x86-32' : { 'url' : 'x86_32/lib32/libc.so' } , 'x86-64' : { 'url' : 'x86_64/lib64/libc.so' } , } , 'libgcc_s.so.1' : { 'arm' : { 'url' : 'arm/libarm/libgcc_s.so.1' } , 'x86-32' : { 'url' : 'x86_32/lib32/libgcc_s.so.1' } , 'x86-64' : { 'url' : 'x86_64/lib64/libgcc_s.so.1' } , } , 'libpthread.so.0' : { 'arm' : { 'url' : 'arm/libarm/libpthread.so.0' } } , 'libpthread.so' : { 'x86-32' : { 'url' : 'x86_32/lib32/libpthread.so' } , 'x86-64' : { 'url' : 'x86_64/lib64/libpthread.so' } , } , } , 'program' : { 'arm' : { 'url' : 'arm/libarm/elf_loader_arm.nexe' } , 'x86-32' : { 'url' : 'x86_32/lib32/runnable-ld.so' } , 'x86-64' : { 'url' : 'x86_64/lib64/runnable-ld.so' } , } } expected_staging = [ PosixRelPath ( f , self . tempdir ) for f in nexes ] expected_staging . extend ( [ 'x86_32/lib32/libc.so' , 'x86_32/lib32/libgcc_s.so.1' , 'x86_32/lib32/libpthread.so' , 'x86_32/lib32/runnable-ld.so' , 'x86_64/lib64/libc.so' , 'x86_64/lib64/libgcc_s.so.1' , 'x86_64/lib64/libpthread.so' , 'x86_64/lib64/runnable-ld.so' , 'arm/libarm/elf_loader_arm.nexe' , 'arm/libarm/libpthread.so.0' , 'arm/libarm/ld-nacl-arm.so.1' , 'arm/libarm/libgcc_s.so.1' , 'arm/libarm/libc.so.0.1' ] ) self . assertManifestEquals ( nmf , expected_manifest ) self . assertStagingEquals ( expected_staging ) finally : os . chdir ( old_path )
Test that when the nmf root is a relative path that things work.
Test that when the nmf root is a relative path that things work .
"""Test that when the nmf root is a relative path that things work."""
self