
2Rc        
   @   s   d  d k  Z  d  d k Z d  d k Z d  d k Z d  d k Z d  d k l Z d  d k l Z d e e f d     YZ	 d e f d     YZ
 d S(   iN(   t   Test(   t	   BuildTestt   Xv6Testc           B   s)   e  Z d Z d Z d  Z d Z d   Z RS(   i   s   tester.cc         C   s~  |  i  d |  i } |  i d t |   t i | |  i d  |  i d d g  } | p d  Sd } |  i o
 d } n |  i d | d	  t	 i
 d | d	 d
 |  i d |  i d d  } |  i o) t i d d d d d g d
 |  i n | i d  | i d  | i d  | i d d g  } | d j o |  i d  n |  i o | i   n | i   |  i   d  S(   Nt   /s   Running xv6 user progam s   /user/tester.cs   xv6.imgs   fs.imgs   qemu-noxs   qemu-gdbs   make s    CPUS=1t   cwdt   logfilet   timeoutt   xterms   -titles   "gdb"s   -et   gdbs   init: starting shs   $ t   testers   TEST PASSEDi   s   tester failed(   t	   test_pathR	   t   logt   strt   shutilt   copyt   project_patht   maket   use_gdbt   pexpectt   spawnt   logfdt   Nonet
   subprocesst   Popent   expect_exactt   sendlinet   failt   waitt   closet   done(   t   selft   tester_patht
   is_successt   targett   childt   index(    (    s8   /afs/cs.wisc.edu/p/course/cs537-remzi/ta/tests/1b/xv6.pyt   run   s6    

			


N(   t   __name__t
   __module__R   t   namet   descriptionR   R	   R$   (    (    (    s8   /afs/cs.wisc.edu/p/course/cs537-remzi/ta/tests/1b/xv6.pyR      s
   t   Xv6Buildc           B   s&   e  Z d  Z d Z d Z d d g Z RS(   t   builds   build xv6 using makei<   s   xv6.imgs   fs.img(   R%   R&   R'   R(   R   t   targets(    (    (    s8   /afs/cs.wisc.edu/p/course/cs537-remzi/ta/tests/1b/xv6.pyR)   3   s   (   R   R   t   osR   t	   toolspatht   testingR    R*   R   R   R)   (    (    (    s8   /afs/cs.wisc.edu/p/course/cs537-remzi/ta/tests/1b/xv6.pyt   <module>   s
   0+