Admin/isatest/isatest-makeall
changeset 24753 88e34d7af6e3
parent 24647 212c9b342a67
child 24758 53c1a0a46db3
equal deleted inserted replaced
24752:8aec6154bb17 24753:88e34d7af6e3
    16 PRG="$(basename "$0")"
    16 PRG="$(basename "$0")"
    17 
    17 
    18 function usage()
    18 function usage()
    19 {
    19 {
    20   echo
    20   echo
    21   echo "Usage: $PRG settings1 [settings2 ...]"
    21   echo "Usage: $PRG [-l logic targets] settings1 [settings2 ...]"
    22   echo
    22   echo
    23   echo "  Runs isatool makeall for specified settings."
    23   echo "  Runs isatool makeall for specified settings."
    24   echo "  Leaves messages in ${ERRORLOG} and ${LOGPREFIX} if it fails."
    24   echo "  Leaves messages in ${ERRORLOG} and ${LOGPREFIX} if it fails."
    25   echo
    25   echo
       
    26   echo "Examples:"
       
    27   echo "  $PRG ~/settings/at-poly ~/settings/at-sml"
       
    28   echo "  $PRG -l HOL \"HOL-Library HOL-Bali\" ~/settings/at-poly"
    26   exit 1
    29   exit 1
    27 }
    30 }
    28 
    31 
    29 function fail()
    32 function fail()
    30 {
    33 {
    81         # be nice by default
    84         # be nice by default
    82         NICE=nice
    85         NICE=nice
    83         ;;
    86         ;;
    84 esac
    87 esac
    85 
    88 
       
    89 ISATOOL="$DISTPREFIX/Isabelle/bin/isatool"
       
    90 
       
    91 [ -x $ISATOOL ] || fail "Cannot run $ISATOOL"
       
    92 
       
    93 if [ "$1" = "-l" ]; then
       
    94   shift
       
    95   [ "$#" -lt "3" ] && usage
       
    96   LOGIC="$1"
       
    97   TARGETS="$2"
       
    98   shift 2
       
    99   ISABELLE_HOME="$($ISATOOL getenv -b ISABELLE_HOME)"
       
   100   TOOL="cd $ISABELLE_HOME/$LOGIC; $NICE $ISATOOL make $MFLAGS $TARGETS"
       
   101 else
       
   102   TOOL="$NICE $ISATOOL makeall $MFLAGS all"
       
   103 fi
       
   104 
    86 # main test loop
   105 # main test loop
    87 
   106 
    88 for SETTINGS in $@; do
   107 for SETTINGS in $@; do
    89 
   108 
    90     [ -r $SETTINGS ] || fail "Cannot read $SETTINGS."
   109     [ -r $SETTINGS ] || fail "Cannot read $SETTINGS."
   100     touch $RUNNING/$SHORT.running
   119     touch $RUNNING/$SHORT.running
   101 
   120 
   102     echo ------------------- starting test --- `date` --- $HOSTNAME > $TESTLOG 2>&1
   121     echo ------------------- starting test --- `date` --- $HOSTNAME > $TESTLOG 2>&1
   103 
   122 
   104     cat $SETTINGS >> $DISTPREFIX/Isabelle/etc/settings
   123     cat $SETTINGS >> $DISTPREFIX/Isabelle/etc/settings
   105     (ulimit -t $MAXTIME; $NICE $DISTPREFIX/Isabelle/bin/isatool makeall $MFLAGS all >> $TESTLOG 2>&1)
   124     (ulimit -t $MAXTIME; $TOOL >> $TESTLOG 2>&1)
   106 
   125 
   107     if [ $? -eq 0 ]
   126     if [ $? -eq 0 ]
   108     then
   127     then
   109         # test log and cleanup
   128         # test log and cleanup
   110         echo ------------------- test successful --- `date` --- $HOSTNAME >> $TESTLOG 2>&1
   129         echo ------------------- test successful --- `date` --- $HOSTNAME >> $TESTLOG 2>&1