def find_executable(executable): ''' Finds executable in PATH Returns: string or None ''' logger = logging.getLogger(__name__) logger.debug("Checking executable '%s'...", executable) executable_path = _find_executable(executable) found = executable_path is not None if found: logger.debug("Executable '%s' found: '%s'", executable, executable_path) else: logger.debug("Executable '%s' not found", executable) return executable_path
def find_executable(names): for possible in names: result = _find_executable(possible) if result is not None: return result return None
#----------------------------------------------------------------------- from tools.simulation.SimulationTool import SimulationTool from tools.translation.verilator_sim import TranslationTool from tools.translation.cpp_sim import get_cpp from tools.integration.verilog import VerilogModel #----------------------------------------------------------------------- # py.test decorators #----------------------------------------------------------------------- from pytest import mark as _mark from distutils.spawn import find_executable as _find_executable from os.path import exists as _exists _has = lambda x: _find_executable( x ) != None requires_xcc = _mark.skipif( not( _has('maven-gcc') and _has('maven-objdump') ), reason='requires cross-compiler toolchain' ) requires_vmh = _mark.skipif( not _exists('../tests/build/vmh'), reason='requires vmh files' ) requires_iverilog = _mark.skipif( not( _has('iverilog') ), reason='requires iverilog' ) requires_verilator = _mark.skipif( not( _has('verilator') ), reason='requires verilator' ) #----------------------------------------------------------------------- # pymtl namespace
#----------------------------------------------------------------------- from tools.simulation.SimulationTool import SimulationTool from tools.translation.verilator_sim import TranslationTool from tools.translation.cpp_sim import get_cpp from tools.integration.verilog import VerilogModel #----------------------------------------------------------------------- # py.test decorators #----------------------------------------------------------------------- from pytest import mark as _mark from distutils.spawn import find_executable as _find_executable from os.path import exists as _exists _has = lambda x: _find_executable(x) != None requires_xcc = _mark.skipif(not (_has('maven-gcc') and _has('maven-objdump')), reason='requires cross-compiler toolchain') requires_vmh = _mark.skipif(not _exists('../tests/build/vmh'), reason='requires vmh files') requires_iverilog = _mark.skipif(not (_has('iverilog')), reason='requires iverilog') requires_verilator = _mark.skipif(not (_has('verilator')), reason='requires verilator') #----------------------------------------------------------------------- # pymtl namespace