#!/bin/bash
bugrev=c766cb7

#Check if coverage is being run. If so, don't use time limit.
if [ `basename $2` = "coverage" ] ; then
    cov=0
else
    cov=1
fi

run_test()
{
    cd libtiff
    if [ $cov -eq 0 ] ; then
        /usr/bin/perl /root/mountpoint-genprog/genprog-many-bugs/libtiff-bug-2007-07-08-c766cb7-0cc95fb/libtiff-run-tests.pl $1
    else
        /root/mountpoint-genprog/genprog-many-bugs/libtiff-bug-2007-07-08-c766cb7-0cc95fb/limit /usr/bin/perl /root/mountpoint-genprog/genprog-many-bugs/libtiff-bug-2007-07-08-c766cb7-0cc95fb/libtiff-run-tests.pl $1
    fi
    RESULT=$?
    
    cd ..
    return $RESULT
}
case $1 in
    p1) run_test 5 && exit 0 ;; 
    p2) run_test 6 && exit 0 ;; 
    p3) run_test 7 && exit 0 ;; 
    p4) run_test 8 && exit 0 ;; 
    p5) run_test 20 && exit 0 ;; 
    p6) run_test 21 && exit 0 ;; 
    p7) run_test 69 && exit 0 ;; 
    p8) run_test 70 && exit 0 ;; 
    p9) run_test 71 && exit 0 ;; 
    p10) run_test 72 && exit 0 ;; 
    p11) run_test 73 && exit 0 ;; 
    p12) run_test 74 && exit 0 ;; 
    p13) run_test 75 && exit 0 ;; 
    p14) run_test 76 && exit 0 ;; 
    p15) run_test 77 && exit 0 ;; 
    p16) run_test 78 && exit 0 ;; 
    n1) run_test 1 && exit 0 ;; 
    n2) run_test 2 && exit 0 ;; 
    n3) run_test 9 && exit 0 ;; 
    n4) run_test 10 && exit 0 ;; 
    n5) run_test 11 && exit 0 ;; 
    n6) run_test 12 && exit 0 ;; 
    n7) run_test 13 && exit 0 ;; 
    n8) run_test 14 && exit 0 ;; 
    n9) run_test 15 && exit 0 ;; 
    n10) run_test 16 && exit 0 ;; 
    n11) run_test 17 && exit 0 ;; 
    n12) run_test 22 && exit 0 ;; 
    n13) run_test 24 && exit 0 ;; 
    n14) run_test 25 && exit 0 ;; 
    n15) run_test 26 && exit 0 ;; 
    n16) run_test 27 && exit 0 ;; 
    n17) run_test 28 && exit 0 ;; 
    n18) run_test 39 && exit 0 ;; 
    n19) run_test 40 && exit 0 ;; 
    n20) run_test 41 && exit 0 ;; 
    n21) run_test 43 && exit 0 ;; 
    n22) run_test 44 && exit 0 ;; 
    n23) run_test 45 && exit 0 ;; 
    n24) run_test 46 && exit 0 ;; 
    n25) run_test 47 && exit 0 ;; 
    n26) run_test 48 && exit 0 ;; 
    n27) run_test 49 && exit 0 ;; 
    n28) run_test 50 && exit 0 ;; 
    n29) run_test 51 && exit 0 ;; 
    n30) run_test 53 && exit 0 ;; 
    n31) run_test 54 && exit 0 ;; 
    n32) run_test 55 && exit 0 ;; 
    n33) run_test 56 && exit 0 ;; 
    n34) run_test 57 && exit 0 ;; 
    n35) run_test 58 && exit 0 ;; 
    n36) run_test 59 && exit 0 ;; 
    n37) run_test 60 && exit 0 ;; 
    n38) run_test 61 && exit 0 ;; 
    n39) run_test 63 && exit 0 ;; 
    n40) run_test 64 && exit 0 ;; 
    n41) run_test 65 && exit 0 ;; 
    n42) run_test 66 && exit 0 ;; 
    n43) run_test 67 && exit 0 ;; 
    n44) run_test 68 && exit 0 ;; 
esac
exit 1