Diff

Differences From Artifact [db5cad6f63]:

To Artifact [6cafb5c1e8]:


    12     12   rm -rf "${WEBDIR}"
    13     13   mkdir -p "${WEBDIR}" || exit 1
    14     14   
    15     15   cp -r kits/* "${WEBDIR}"
    16     16   
    17     17   ln -s ../index.ttml "${WEBDIR}/" >/dev/null 2>/dev/null
    18     18   
           19  +totaltests_count="$(ls -1 tests/*.tcl | wc -l)"
           20  +
    19     21   for file in "${WEBDIR}"/*; do
    20     22   	if [ -d "${file}" ]; then
    21     23   		continue
    22     24   	fi
    23     25   
    24     26   	if echo "${file}" | egrep '\.(log|desc|ttml)$' >/dev/null; then
    25     27   		continue
    26     28   	fi
    27     29   
           30  +	# Find out which tests failed
           31  +	failedtests_count="0"
           32  +	failedtests=""
           33  +	for faillog in "${file}"-[0-9][0-9]-*.log; do
           34  +		if [ ! -f "${faillog}" ]; then
           35  +			continue
           36  +		fi
           37  +
           38  +		failedtests_count=$[${failedtests} + 1]
           39  +		failedtests="${failedtests} $(basename "${faillog}")"
           40  +	done
           41  +
           42  +	# Generate description
    28     43   	descfile="${file}.desc"
    29     44   	shortfile="$(basename "${file}")"
    30     45   	desc=""
    31     46   
    32     47   	tclversion="$(echo "${shortfile}" | cut -f 2 -d -)"
    33     48   	parts="$(echo "${shortfile}" | cut -f 3- -d -)"
    34     49   
................................................................................
    81     96   		fi
    82     97   	done
    83     98   
    84     99   	if [ -z "${desc}" ]; then
    85    100   		continue
    86    101   	fi
    87    102   
          103  +	# Generate better Tcl version
    88    104   	case "${tclversion}" in
    89    105   		cvs_HEAD)
    90    106   			tclversion="from CVS HEAD"
    91    107   			;;
    92    108   		cvs_*)
    93    109   			tclversion="from CVS tag $(echo "${tclversion}" | cut -f 2 -d _)"
    94    110   			;;
    95    111   	esac
          112  +
          113  +	# Update description with count of failed tests
          114  +	if [ "${failedtests_count}" != "0" ]; then
          115  +		desc="${desc} (FAILED ${failedtests_count} of ${totaltests_count} tests)"
          116  +	fi
    96    117   
    97    118   	desc="is a Tclkit for Tcl ${tclversion}${desc}"
    98    119   
    99         -	echo "${desc}" > "${descfile}"
   100    120   done
   101         -
   102    121   
   103    122   rmdir "${WEBDIR}/failed" >/dev/null 2>/dev/null
   104    123   ln -s ../index.ttml "${WEBDIR}/failed/" >/dev/null 2>/dev/null
   105    124   
   106    125   exit 0