X11 Graphics Tests

The xtests package contains X11 Graphics Tests for UnixWare 7 and OpenServer 5:

Unisoft Test Suites
The complete Unisoft Test Suite. Can optionally be installed.

xbench
The xbench program

x11perf
The x11perf program

Version 7.1.0 of the xtests package differs from previous versions in the following ways:

  • The xtests package can be used on both UnixWare 7 and OpenServer 5

  • Changed RunTests scripts to work on OpenServer with UDK installed.

For current information about the entire UnixWare/OpenServer Hardware Developers Kit (HDK) release, see the HDK Release Notes.

Note: Documentation references on this page link to the Product Documentation. They are also available on your local UnixWare 7 system when the baseMAN, HDKdoc, and HDKman packages are installed.

System requirements

This package has no dependencies. It can be installed and run on both UnixWare 7 and OpenServer systems.

See the UDK documentation for more information. This is particularly important for OpenServer 5 users.

Installation

Before installing this version of the xtests package on your system, you must remove any earlier versions.

To install the package from:

downloaded files

  1. Log in as root.
  2. Download the package to an installation directory; for example, /tmp.
  3. Use the pkgadd(1M) command to install it by entering:
    pkgadd  -d  /tmp/xtests

media distribution

  1. Log in as root.
  2. Insert the CD-ROM in the drive.
  3. On OpenServer systems:
    • Create a cdrom directory if it does not already exist:
      mkdir  /cdrom
    • Mount the CD-ROM by typing:
      mount  -r  /dev/cd0  /cdrom
    • Use the pkgadd(ADM) command to install it by entering:
      pkgadd  -d  /cdrom  xtests

    On UnixWare systems:
    • Use the pkgadd(1M) command to install it by entering:
      pkgadd  -d  cdrom1  xtests

You will be prompted for a directory name in which to install the test suite.

Configuration

Always use the RunTests scripts to run the different tests:

RunTests
runs the complete Unisoft Test Suite

Xserver/tests/xbench/RunTests
runs the xbench program

Xserver/tests/x11perf/RunTests
runs the x11perf program

Known limitations

The following limitations exist in this release:

  • OpenServer 5 users must have the UDK installed before using the RunTests scripts so that binaries can be built and executed. The UDK compilation tools cannot, however, be used to build OpenServer graphics drivers.
  • The xtests suites use Port :7.0 which is not available by default on OpenServer systems. You can select a different port from the menu, manually create this port with the mknod command on OpenServer systems, or you can replace the RunTests script on your system with the RunTests script included in this /info file that uses Port :5.0 by default. To replace the RunTests script, install the xtests package and mount the HDK CD-ROM, then issue a command similar to the following:

    cp /cdrom/info/xtests/RunTests /usr/src/ihvkit/display/test/xsuite

    This example assumes that the HDK CD-ROM is mounted on the /cdrom directory and that the xtest package is installed in the default location. If you do not have the HDK CD-ROM, use the RunTests script below.

#!/bin/sh
# this script runs on UW7, OSR5, and UW2 so Bourne shell only...
#
#	%W%	%G%	%U%
#
#

# force C locale
LC_ALL=C; export LC_ALL

# while leaving DISPLAY set can cause problems, we allow it.
# unset DISPLAY

# This script is only installed when the user has selected the Unisoft 
# test suite.  it is part of the "uts" packaging class.  We then know that
# our postinstall has created a symlink telling us where TET_ROOT should
# point.  We use that instead of relying on pkgparam (OSR5 consideration)
#TET_ROOT=/usr/src/ihvkit/display/test/xsuite

TET_ROOT=`pkgparam xtests TETROOT 2>/dev/null`
if [ "${TET_ROOT}" = "" ] ; then
	# user did not want to install the Unisoft Test Suite when xtests 
	# installed or some kind of pkgparam error occurred.  Should 
	# not happen. 
	echo "Unisoft Test Suite not installed, aborting."
	exit 1
fi

OS=`pkgparam xtests OS 2>/dev/null`
if [ "${OS}" = "" ] ; then
	echo "Unknown OS, terminating."
	exit 1
fi

NEEDUDK=`pkgparam xtests NEEDUDK 2>/dev/null`
if [ "${NEEDUDK}" = "true" ] ; then
	if [ "${OS}" = "OSR5" ] ; then
		ADD1="(requires UDK compiler and xdevsys packages from UDK)"
		ADD2="(requires OSRcompat package from UDK)"
	elif [ "${OS}" = "UW2" ] ; then
		ADD1="(requires UDK compiler and xdevsys packages from UDK)"
		ADD2="(requires UW2compat package from UDK)"
	else
		ADD1="(requires xdevsys packages from UDK)"
		ADD2=""
	fi
else
	ADD1=""
	ADD2=""
fi

TET_TMP_DIR=/usr/tmp
# use UDK binaries first to use UDK [compiler] if running on OpenServer
# otherwise put both /usr/X/bin and /usr/bin/X11 styles in PATH
# when looking for xdpyinfo and xset.  Need /bin and /usr/bin for things
# like cut
PATH=/udk/bin:/udk/usr/bin:/udk/usr/ccs/bin:/udk/usr/X/bin:/bin:/usr/bin:/usr/X/bin:${TET_ROOT}/scripts:${TET_ROOT}/xtest/bin:/usr/bin/X11:/usr/X11R6.1/bin:$PATH
TTY=`tty`
# XSERVER correct for UW7/OSR5 too
XSERVER=/usr/bin/X11/X		#  Change this to run other X servers
				#  default is /usr/bin/X11/X
CFG_ORIG=tetexec.cfg.orig	#  Create other cfg templates for custom runs
				#  default is tetexec.cfg.orig

GRAFDEV=/usr/lib/grafinfo/grafdev	# only present on UW7 and OSR5

export TET_ROOT PATH TET_TMP_DIR

ServerTty() {

	# $1 is server process ID.
	# do not use awk, the WCHAN column may/may not have value
	# which skew field numbers depending on if server blocked at this
	# instant.  UW7 prints tty with printf(" %-7.14s", tp);
	##ps -lp $1  | awk '/X/ {print $13}'
	if [ "${OS}" = "UW7" ] ; then
		ps -lp $1 | tail -1 | cut -c64-78 | awk '{print $1}'
	elif [ "${OS}" = "UW2" ] ; then
		ps -lp $1 | tail -1 | cut -c61-75 | awk '{print $1}'
	elif [ "${OS}" = "OSR5" ] ; then
		# has field of at least 7 chars bit, no limit
		ps -lp $1 | tail -1 | cut -c60-80 | awk '{print $1}'
	fi
}

cd ${TET_ROOT}

while true
do
	if [ "${OS}" = "OSR5" ] ; then
		echo "\nPlease select one of the following tasks:"
		echo "1     Build the test suite${ADD1}"
		echo "2     Run the test suite${ADD2}"
		echo "3     Generate report from the most recent run"
		echo "4     Exit"
		echo ""
		echo -n "Enter selection [?,??]: "
		read TASK
	else
		TASK=`ckitem -Q -uo -l "Please select one of the following tasks:" \
			"1	Build the test suite${ADD1}" \
			"2	Run the test suite${ADD2}" \
			"3	Generate report from the most recent run" \
			"4	Exit"` 
	fi

	case "${TASK}" in
		###########################################################
		# build using UDK compiler if on OSR5 (revised PATH)
		# This can take quite a long time depending on the machine.  My trick is
		# to move /bin/make out of the way, create a new /bin/make which echos its
		# arguments to some tty, then invokes the real make binary.  This way you
		# can track the progress of the build.
		#
		# Common problem here is that cc cannot find Xlib.h as xdevsys package has
		# not been installed yet, tsk tsk.
		1) echo "Building tests.  This can take a long time, please wait..."
			make build;;
		###########################################################
		2) 
		if [ "${OS}" = "OSR5" -o "${OS}" = "UW2" ] ; then	# no ckstr on UW2
			echo "\nPlease specify the hostname of the machine to which the display is"
			echo -n "physically attached (default: localhost) [?] "
			read DH
			if [ "${DH}" = "" ] ; then
				DH="localhost"
			fi

			echo "\nPlease specify the display and screen to run the test for:"
			echo "  1  :0.0"
			echo "  2  :1.0"
			echo "  3  :2.0"
			echo "  4  :3.0"
			echo "  5  :4.0"
			echo "  6  :5.0"
			echo ""
			echo -n "Enter selection (default: :5.0) [?,??]: "
			read DP
			if [ "${DP}" = "" ] ; then
				DP=":5.0"
			else 
				case "${DP}" in
					1) DP=":0.0";;
					2) DP=":1.0";;
					3) DP=":2.0";;
					4) DP=":3.0";;
					5) DP=":4.0";;
					6) DP=":5.0";;
					*) DP=":5.0";;
				esac
			fi
		else
			DH=`ckstr -Q -p \
				"Please specify the hostname of the machine to which the display is physically attached" \
				-d localhost`
			DP=`ckitem -Q -o -l \
				"Please specify the display and screen to run the test for:" \
				-d ":5.0" :0.0 :1.0 :2.0 :3.0 :4.0 :5.0` 
		fi

		if [ "${DH}" = "localhost" ] ; then
			echo "Starting ${XSERVER} on ${DH}${DP}"
			# note this will use UDK version of uname when 
			# run on UW2 and OSR5 due to revised PATH
			DH=`uname -n`
			${XSERVER} ${DP} &
			S_PID=$!
			TTY=/dev/`ServerTty ${S_PID}`
			sleep 10

			kill -0 ${S_PID} 2>/dev/null || {
   			echo "trouble starting X server, terminating."
   			exit 1
			}

		else
			echo "On the remote host ${DH}, please run:"
			echo "	${XSERVER} ${DP}"
			echo "	DISPLAY=unix${DP}; export DISPLAY"
			echo "	xhost + `uname -n` "
			if [ "${OS}" = "OSR5" ] ; then
				# no help option here
				echo -n "\nIs the remote X server started successfully (default: y) [yes,no,quit] "
				read junk
				if [ "${junk}" != "" -a "${junk}" != "y" -a "${junk}" != "yes" -a "${junk}" != "Yes" ] ; then
					echo "Please run the UTS test suite at a later time."
					exit 2
				fi
			else
				# UW2 or UW7
				if [ `ckyorn -d y -p "Is the remote X server started successfully"` != y ] ; then 
					echo "Please run the UTS test suite at a later time."
					exit 2
				fi # if remote X server started
			fi  # if running on OSR5
		fi # if display host is localhost

		echo -n "Generating xtest/tetexec.cfg ..."
		TMPFILE=/tmp/xdpyinfo.${DH}${DP}
		# we hope X server has started by now, if not this will fail.
		xdpyinfo -display ${DH}${DP} > ${TMPFILE} 2>/dev/null || {
			echo ""
			echo "ERROR!"
			echo "Could not obtain display information from the X server running"
			echo "on ${DH}${DP}.  Perhaps the X server had trouble starting?"
			echo "Terminating."
			exit 1
		}
		# pixmap depth
		PMD=`grep "depths (" ${TMPFILE} | cut -d ":" -f 2 | awk '{print $1 $2}' | tr "," " "`
		# black pixel value
		BP=`grep black ${TMPFILE} | cut -d ":" -f 2 | cut -d "," -f 1 | awk '{print $2}'`
		# white pixel value
		WP=`grep white ${TMPFILE} | cut -d ":" -f 2 | cut -d "," -f 2 | awk '{print $2}'`
		# height mm
		HMM=`grep millimeters ${TMPFILE} | cut -d "(" -f 2 | cut -d "x" -f 2 | awk '{print $1}'`
		# width mm
		WMM=`grep millimeters ${TMPFILE} | cut -d "(" -f 2 | cut -d "x" -f 1`
		# vendor string
		VS=`grep "vendor string" ${TMPFILE} | cut -d ":" -f 2 | cut -d " " -f 5-`
		# vendor release
		VR=`grep "vendor release number" ${TMPFILE} | cut -d ":" -f 2 | cut -d " " -f 5-`
		# motion buffer size
		MBS=`grep "motion buffer size" ${TMPFILE} | cut -d ":" -f 2 | cut -d " " -f 3-`

		awk -f scripts/tetexec.awk \
			DH="${DH}" DP="${DP}" PMD="${PMD}" BP="${BP}" WP="${WP}" \
			HMM="${HMM}" WMM="${WMM}" VS="${VS}" VR="${VR}" MBS="${MBS}" \
			< xtest/${CFG_ORIG} > xtest/tetexec.cfg
		/bin/rm -f ${TMPFILE}
		echo "Done."

		# when adding fonts we
		# can not use /usr/lib/X11/fonts/xtest directory
		# in line below because prototype file does not use this
		# directory and each OS has symlink mappings for fonts; must
		# use same directory as found in prototype to ensure
		# xset can find and use it.
		# xset fp+ /usr/lib/X11/fonts/xtest -display ${DH}${DP}
		xset fp+ /usr/X/lib/X11/fonts/xtest -display ${DH}${DP}

		# build using UDK compiler if on OSR5 (revised PATH)
		make exec
		if [ ! -z "${S_PID}" ] 
		then
			kill -15 ${S_PID}
			sleep 5
		fi;;

		###########################################################
		3)	if  [ ! -d reports ]
			then
				mkdir reports > /dev/null 2>&1
			fi

			if [ -n "${S_PID}" ]; then
				RptID="${S_PID}"
			else
				RptID=$$
			fi

			# results directory should be there, check to make sure
			if [ ! -d xtest/results ] ; then
				echo "${TET_ROOT}/xtest/results directory not found, aborting"
				exit 1
			fi

			# empty is a zero length file in the results directory
			NUM=`ls -1 xtest/results | grep -v empty | tail -1`  # latest journal
			if [ ${NUM} = "" ] 
			then
				echo "No journal present in ${TET_ROOT}/xtest/results."
			else
				JOURNAL=`ls -rt xtest/results/*e/journal | tail -1`
				echo -n "Generating reports for journal file: ${JOURNAL}"

				# UW2 does not have grafinfo file, must prompt user
				if [ "${OS}" = "UW2" ] ; then
   				echo "Please select the TTY on which the tests were run(possibly ${TTY}),"
					echo -n "including /dev/ "
					read TTY
				else 
					# UW7 or OSR5, use grafdev if available
					if [ ! -f ${GRAFDEV} ] ; then
						if [ "${OS}" = "UW7" ] ; then
							CHOICES="/dev/vt01 /dev/vt02 /dev/vt03 /dev/vt04 /dev/vt05 /dev/vt06 /dev/vt07 /dev/vt08 /dev/vt09 /dev/vt10 /dev/vt11 /dev/vt12"
						fi
						if [ "${OS}" = "OSR5" ] ; then
							CHOICES="/dev/console /dev/tty01 /dev/tty02 /dev/tty03 /dev/tty04 /dev/tty05 /dev/tty06 /dev/tty07 /dev/tty08 /dev/tty09 /dev/tty10 /dev/tty11 /dev/tty12"
						fi
					else
						CHOICES=`cat ${GRAFDEV} | cut -d ":" -f 1`
					fi
					if [ "${OS}" = "OSR5" ] ; then
						echo "\nPlease type the name of the TTY on which the tests "
						echo "were run from the list below:"
						echo ${CHOICES}
						echo ""
						echo -n "Type the full device name including /dev "
						read TTY
					else
						TTY=`ckitem -Q -o -l "Please select the TTY on which the tests were run:" -d "/dev/vt01" $CHOICES`
					fi
				fi
				echo "Generating reports for journal file: ${JOURNAL} ... \c"
				if [ -f ${GRAFDEV} ] ; then
					junk=`grep ${TTY} ${GRAFDEV}`
				else
					# UW2, do not both calling xdpyinfo for these values.
					junk="/some/path:unknown.adapter.resolution.color"
				fi
				FILE=`echo ${junk} | cut -d ":" -f 2`.${RptID}.`basename ${XSERVER}`
				header ${TTY} ${XSERVER} ${JOURNAL} > reports/${FILE}.fail
				rpt -s > reports/${FILE}.verbose
				all_summary ${JOURNAL} >> reports/${FILE}.fail
				nopass reports/${FILE}.verbose >> reports/${FILE}.fail
				echo "\nDone. Reports are saved as ${TET_ROOT}/reports/${FILE}.fail\n\tand ${FILE}.verbose."
			fi;;
		###########################################################
		4) exit 0;;
		###########################################################
		*) echo "Unexpected argument ${TASK}";;
		esac
done

For more information

More information concerning xtests may be found in the Hardware and Driver Development Documentation.

The following is the top-level xtests README (~/test/xsuite/README):


+++++++++++

This file describes the software in X11 Release 6.1 of the
Xlib and X Protocol Test Suite from the X Consortium.

The main directories to be aware of initially are:

xtest/doc - This contains the documentation. It contains a user guide,
programmers guide and release notes. These are supplied in troff(1)
format requiring the mm macro package, and also in PostScript format.
You should look at the release notes and the user guide before
attempting to install and build the test suite.

xtest - This contains the tests included in the X Test Suite
which are stored as a complete TET test suite. This includes all
necessary configuration files and scenario files to enable you to use
the X test suite following the instructions in the documentation.

tet - This contains the source files and include files needed to build
the Test Environment Toolkit (TET).

Please note that this test suite tests functionality up through X11R4,
and has not been generally upgraded to test new functionality added since
then.  As of X11R6.1, this test suite is considered unsupported software
by X Consortium Inc, and no further development is planned.

For those who require a more up-to-date test suite with available support,
X/Open Company Ltd. offers VSW5, a successor to the X Consortium Test Suite.
VSW5 includes many bug fixes and a large number of new tests for Xt and
for new R5 functionality.  R6 tests are planned for the future.  Refer
to http://www.xopen.org/public/test/vsw45.htm for more information.



Document version 7.1.0a
08 July 1999