def test_logged_call(self): if os.path.exists( os.path.join(_Config.ROOT_DIR, 'log.tmp') ): os.remove( os.path.join(_Config.ROOT_DIR, 'log.tmp') ) e1 = Executor( _Config.ROOT_DIR ) e1.logged_call( 'echo THOR', logfile='log.tmp' ) with open(os.path.join(_Config.ROOT_DIR, 'log.tmp'), 'r') as f: self.assertEqual( f.readline().strip('\n'), 'THOR' ) os.remove( os.path.join(_Config.ROOT_DIR, 'log.tmp') )
def optimize(self) -> int: executor = Executor( cwd=self.work_dir ) executor.logged_call( cmd='strip ./main.native', logfile='strip.log' ) return executor.pid
def compile(self) -> int: # TODO: Need better exception handling executor = Executor( cwd=self.work_dir ) executor.logged_call( cmd='make', logfile='compile.log' ) return executor.pid
def configure(self) -> int: # TODO: Need better exception handling executor = Executor( cwd=self.work_dir ) executor.logged_call( cmd='mirage configure --unix', logfile='configure.log' ) return executor.pid
def start(self) -> int: executor = Executor( cwd=self.work_dir ) executor.logged_call( cmd='./main.native', logfile='stdout.log', stderr=True # FIXME: Mirage console prints to stderr by default ) Status.set( self._id, executor.probe_status() ) return executor.pid