main_testing4/knight_test.sh
changeset 352 97bcf8efe4e0
parent 347 4de31fdc0d67
child 376 6cc36d0ef79e
equal deleted inserted replaced
351:591b9005157e 352:97bcf8efe4e0
    43   
    43   
    44 echo -e "knight1.scala runs?" >> $out
    44 echo -e "knight1.scala runs?" >> $out
    45 
    45 
    46 if (scala_compile knight1.scala)
    46 if (scala_compile knight1.scala)
    47 then
    47 then
    48     echo -e "  --> success " >> $out
    48     echo -e "  --> passed" >> $out
    49     tsts1=$(( 0 ))
    49     tsts1=$(( 0 ))
    50   else
    50   else
    51     echo -e "  --> SCALA DID NOT RUN KNIGHT1.SCALA\n" >> $out
    51     echo -e "  --> SCALA DID NOT RUN KNIGHT1.SCALA\n" >> $out
    52     tsts1=$(( 1 )) 
    52     tsts1=$(( 1 )) 
    53 fi
    53 fi
    62     if (scala_vars knight1.scala)
    62     if (scala_vars knight1.scala)
    63     then
    63     then
    64 	echo -e "  --> FAIL (make triple-sure your program conforms to the required format)" >> $out  
    64 	echo -e "  --> FAIL (make triple-sure your program conforms to the required format)" >> $out  
    65 	tsts1=$(( 1 ))
    65 	tsts1=$(( 1 ))
    66     else
    66     else
    67 	echo -e "  --> success" >> $out
    67 	echo -e "  --> passed" >> $out
    68 	tsts1=$(( 0 )) 
    68 	tsts1=$(( 0 )) 
    69     fi
    69     fi
    70 fi    
    70 fi    
    71 
    71 
    72 
    72 
   174 # compilation test
   174 # compilation test
   175 echo -e "knight2.scala runs?" >> $out
   175 echo -e "knight2.scala runs?" >> $out
   176 
   176 
   177 if (scala_compile knight2.scala)
   177 if (scala_compile knight2.scala)
   178 then
   178 then
   179     echo -e "  --> success" >> $out
   179     echo -e "  --> passed" >> $out
   180     tsts2=$(( 0 ))
   180     tsts2=$(( 0 ))
   181 else
   181 else
   182     echo -e "  --> SCALA DID NOT RUN KNIGHT2.SCALA\n" >> $out  
   182     echo -e "  --> SCALA DID NOT RUN KNIGHT2.SCALA\n" >> $out  
   183     tsts2=$(( 1 )) 
   183     tsts2=$(( 1 )) 
   184 fi
   184 fi
   194     if (scala_vars knight2.scala)
   194     if (scala_vars knight2.scala)
   195     then
   195     then
   196 	echo -e "  --> Fail (make triple-sure your program conforms to the required format)" >> $out    
   196 	echo -e "  --> Fail (make triple-sure your program conforms to the required format)" >> $out    
   197 	tsts2=$(( 1 ))
   197 	tsts2=$(( 1 ))
   198     else
   198     else
   199 	echo -e "  --> success" >> $out
   199 	echo -e "  --> passed" >> $out
   200 	tsts2=$(( 0 )) 
   200 	tsts2=$(( 0 )) 
   201     fi
   201     fi
   202 fi
   202 fi
   203 
   203 
   204 
   204 
   261    
   261    
   262 echo "knight3.scala runs?" >> $out
   262 echo "knight3.scala runs?" >> $out
   263 
   263 
   264 if (scala_compile knight3.scala)
   264 if (scala_compile knight3.scala)
   265 then
   265 then
   266     echo "  --> success" >> $out
   266     echo "  --> passed" >> $out
   267     tsts3=$(( 0 ))
   267     tsts3=$(( 0 ))
   268 else
   268 else
   269     echo -e "  --> SCALA DID NOT RUN KNIGHT3.SCALA\n" >> $out  
   269     echo -e "  --> SCALA DID NOT RUN KNIGHT3.SCALA\n" >> $out  
   270     tsts3=$(( 1 )) 
   270     tsts3=$(( 1 )) 
   271 fi
   271 fi
   279     if (scala_vars knight3.scala)
   279     if (scala_vars knight3.scala)
   280     then
   280     then
   281 	echo "  --> Fail (make triple-sure your program conforms to the required format)xsxs" >> $out
   281 	echo "  --> Fail (make triple-sure your program conforms to the required format)xsxs" >> $out
   282 	tsts3=$(( 1 ))
   282 	tsts3=$(( 1 ))
   283     else
   283     else
   284 	echo "  --> success" >> $out
   284 	echo "  --> passed" >> $out
   285 	tsts3=$(( 0 )) 
   285 	tsts3=$(( 0 )) 
   286     fi
   286     fi
   287 fi
   287 fi
   288 
   288 
   289 
   289