native_client_sdk/src/tools/tests/create_nmf_test.py
def _CreateTestNexe(self, name, arch):
    """Create an empty test .nexe file for use in create_nmf tests.

    This is used rather than checking in test binaries since the
    checked in binaries depend on .so files that only exist in the
    certain SDK that build them.
    """
    if arch == 'arm':
      toolchain = ARM_GLIBC_TOOLCHAIN
    else:
      toolchain = X86_GLIBC_TOOLCHAIN

    compiler = os.path.join(toolchain, 'bin', '%s-nacl-g++' % arch)
    if os.name == 'nt':
      compiler += '.exe'
      os.environ['CYGWIN'] = 'nodosfilewarning'
    program = 'int main() { return 0; }'
    name = os.path.join(self.tempdir, name)
    dst_dir = os.path.dirname(name)
    if not os.path.exists(dst_dir):
      os.makedirs(dst_dir)
    self.assertTrue(os.path.exists(compiler), 'compiler missing: %s' % compiler)
    cmd = [compiler, '-pthread', '-x' , 'c', '-o', name, '-']
    p = subprocess.Popen(cmd, stdin=subprocess.PIPE)
    p.communicate(input=program)
    self.assertEqual(p.returncode, 0)
    return name
Create an empty test .nexe file for use in create_nmf tests.

    This is used rather than checking in test binaries since the
    checked in binaries depend on .so files that only exist in the
    certain SDK that build them.
    
Create an empty test .nexe file for use in create_nmf tests.
This is used rather than checking in test binaries since the
checked in binaries depend on .so files that only exist in the
certain SDK that build them.
Create an empty test . nexe file for use in create_nmf tests . This is used rather than checking in test binaries since the checked in binaries depend on . so files that only exist in the certain SDK that build them .
def _CreateTestNexe(self, name, arch):
    if arch == 'arm':
      toolchain = ARM_GLIBC_TOOLCHAIN
    else:
      toolchain = X86_GLIBC_TOOLCHAIN
    compiler = os.path.join(toolchain, 'bin', '%s-nacl-g++' % arch)
    if os.name == 'nt':
      compiler += '.exe'
      os.environ['CYGWIN'] = 'nodosfilewarning'
    program = 'int main() { return 0; }'
    name = os.path.join(self.tempdir, name)
    dst_dir = os.path.dirname(name)
    if not os.path.exists(dst_dir):
      os.makedirs(dst_dir)
    self.assertTrue(os.path.exists(compiler), 'compiler missing: %s' % compiler)
    cmd = [compiler, '-pthread', '-x' , 'c', '-o', name, '-']
    p = subprocess.Popen(cmd, stdin=subprocess.PIPE)
    p.communicate(input=program)
    self.assertEqual(p.returncode, 0)
    return name
def _CreateTestNexe ( self , name , arch ) : if arch == 'arm' : toolchain = ARM_GLIBC_TOOLCHAIN else : toolchain = X86_GLIBC_TOOLCHAIN compiler = os . path . join ( toolchain , 'bin' , '%s-nacl-g++' % arch ) if os . name == 'nt' : compiler += '.exe' os . environ [ 'CYGWIN' ] = 'nodosfilewarning' program = 'int main() { return 0; }' name = os . path . join ( self . tempdir , name ) dst_dir = os . path . dirname ( name ) if not os . path . exists ( dst_dir ) : os . makedirs ( dst_dir ) self . assertTrue ( os . path . exists ( compiler ) , 'compiler missing: %s' % compiler ) cmd = [ compiler , '-pthread' , '-x' , 'c' , '-o' , name , '-' ] p = subprocess . Popen ( cmd , stdin = subprocess . PIPE ) p . communicate ( input = program ) self . assertEqual ( p . returncode , 0 ) return name
Create an empty test .nexe file for use in create_nmf tests.
Create an empty test . nexe file for use in create_nmf tests .
"""Create an empty test .nexe file for use in create_nmf tests.

    This is used rather than checking in test binaries since the
    checked in binaries depend on .so files that only exist in the
    certain SDK that build them.
    """
self
name
arch