#!/bin/sh
#
#  Copyright(c) 1995 Sun Microsystems, Inc.
#  All rights reserved.

#ident  "@(#)testinfo  1.8  01/04/23  SMI"


# ------------------------------------------------------------
# testinfo list all the testname_info.o file in VTS vtsinfo.a. 
# Usage: testinfo [-l <testname>] [<vtsinfo_directory>]
# ------------------------------------------------------------

usage_error()
{
    echo Usage: $0 "[<vtsinfo_directory>]"
    exit 1
}

libdir=`pwd`
lib=vtsinfo
longlist=0
AR=/usr/ccs/bin/ar

getall() {
    if ( $AR t ${libdir}/${lib}.a > /dev/null 2>&1 )
    then
	if ( $AR t ${libdir}/${lib}.a | grep _info.o > /dev/null )
	then
	    echo found the following "<testname>_info.o" files in ${lib}.a.
	    $AR t ${libdir}/${lib}.a | grep _info.o
	else
	    echo "No <testname>_info.o files found in "${lib}".a."
	fi
    else
        echo "ar error! SunVTS "${lib}".a may not exist."
    fi
}

if [ $# -eq 0 ] ; then  getall ; exit ; fi

if [ $# -ne 1 ] ; then  usage_error ; fi

libdir=$1

if [ ! -d $libdir ] ; then  usage_error ; fi

getall

exit
