#! /bin/sh # # version: 1.0 # author: Susan Hert # # This script creates part of a WWW page with a table of test suite results. # The formatted table is printed to standard output. # # Usage: # create_package_table [d1 d2 ...] # TARGETS="dvi html" # if directory names are provided on the command line, use these as the # directories for which test results are prepared. Otherwise, when in a # directory that contains a wrapper.tex file and a docdirs file assume # this is the directory to work in. If the current directory contains # no wrapper.tex file but a docdirs file, this indicates that a page # should be created for the test results of all subdirectories named in # docdirs. if [ $# -ne 0 ] ; then DOCDIRS="$*" elif [ -f wrapper.tex -a -f docdirs ]; then DOCDIRS="." elif [ -f docdirs ] ; then DOCDIRS=`/bin/cat docdirs` else DOCDIRS="" fi #NT = number of targets NT=0 for i in $TARGETS ; do NT=`expr $NT + 1` done print_makeindex_test_result() { if [ ! -f main.ilg ] ; then echo "?" else if grep '[1-9][0-9]* rejected' main.ilg > /dev/null ; then echo "n" elif grep '[1-9][0-9]* warnings' main.ilg > /dev/null ; then echo "w" else echo "y" fi fi } print_latex_test_result() { if [ ! -f main.log ] ; then echo "?" else for FAILURE in $LATEX_FAILED; do if [ $FAILURE = $TEST_DIR ]; then echo "n" return fi done echo "y" fi } print_html_test_result() { if [ ! -f to_html.log ] ; then echo "?" else for FAILURE in $HTML_FAILED; do if [ $FAILURE = $TEST_DIR ]; then echo "n" return fi done echo "y" fi } print_result_table() { for TEST_DIR in $TEST_DIRECTORIES ; do if [ -d $TEST_DIR ] ; then cd $TEST_DIR echo echo "" if [ $TEST_DIR = "Title" ]; then echo "$PART_NAME" else echo "" fi echo "$TEST_DIR" # if [ -f version ] ; then # echo "`/bin/awk '{ print $1 }' version`" # elif [ $TEST_DIR != "Title" ]; then # echo "?.?" # else # echo "-" # fi RESULT=`print_makeindex_test_result` if [ $RESULT = "y" ]; then echo " \ $RESULT" elif [ $RESULT = "w" ]; then echo " \ $RESULT" elif [ $RESULT = "n" ]; then echo " \ $RESULT" else echo "$RESULT" fi RESULT=`print_latex_test_result` if [ $RESULT = "y" ]; then echo " \ $RESULT" elif [ $RESULT = "w" ]; then echo " \ $RESULT" else echo " \ $RESULT" fi cd .. if [ -d html_test/$TEST_DIR ]; then cd html_test/$TEST_DIR/ RESULT=`print_html_test_result` if [ $RESULT = "y" ]; then echo " \ $RESULT" elif [ $RESULT = "w" ]; then echo " \ $RESULT" else echo " \ $RESULT" fi cd ../.. else echo "not applicable" fi echo "" fi done /bin/cat << EOF EOF } for DIR in $DOCDIRS; do if [ -f $DIR/docdirs ]; then cd $DIR TEST_DIRECTORIES=`cat docdirs` if [ -f docdirs_failed_tex ]; then LATEX_FAILED=`/bin/cat docdirs_failed_tex` else LATEX_FAILED="" fi if [ -f docdirs_failed_html ]; then HTML_FAILED=`/bin/cat docdirs_failed_html` else HTML_FAILED="" fi CURR_DIR=`pwd` case $CURR_DIR in *installation) PART_NAME="Installation";; *general) PART_NAME="General Introduction";; *kernel) PART_NAME="2D and 3D Kernel";; *kernel_d) PART_NAME="dD Kernel";; *basic) PART_NAME="Basic Library";; *support) PART_NAME="Support Library";; *use_of_stl) PART_NAME="Use of STL";; *) echo "UNKNOWN manual part; using name $DIR"; PART_NAME=$DIR;; esac print_result_table cd .. fi done