#!/bin/sh

. ${SRCROOT:=`../../../conf/srcroot.sh`}/tests/bin/base

. ${SRCROOT}/sccs/tests/common/command-names

TESTING_SCCS_V5=false		# Sun SCCS with auto-binary, y2k, ... extensions
TESTING_CSSC=false		# Relict from CSSC tests, also applies to SCCS
TESTING_REAL_CSSC=false		# Don't test real CSSC 4-digit year extensions
TESTING_REAL_SCCS=false		# Don't test Schily SCCS 4 digit year extensions
TESTING_SCCS_V6=false		# Don't test SCCSv6 features

# TESTING_CSSC
# Currently used for:
#	-	whether admin -rxxx works when creating new history files
#	-	whether admin -ycomment works when creating new history files
#	-	whether	admin supports auto-binary mode
#	-	whether admin supports auto-no-newline mode
#	-	whether SCCS is y2k safe

if ( ${admin} -V 2>&1 ; echo xxx ) 2>/dev/null | grep CSSC >/dev/null
then
	#
	# Found "CSSC" in version string
	#
	TESTING_CSSC=true	# Run CSSC test extensions as well
	TESTING_REAL_CSSC=true	# Run tests for non-compliant CSSC year ext.
fi

if ( ${admin} -? 2>&1 ; echo xxx ) 2>/dev/null | grep Usage: >/dev/null
then
	#
	# Found "Usage:" in "$cmd -?" output
	#
	TESTING_SCCS_V5=true	# Run SCCS_V5 test extensions as well
	TESTING_CSSC=true	# Run CSSC test extensions as well
fi

if ( ${admin} -V 2>&1 ; echo xxx ) 2>/dev/null | grep SCCS >/dev/null
then
	#
	# Found "SCCS" in version string
	#
	if test ".$CSSC_ONLY" = ".true"
	then
		:		  # CSSC_ONLY: additional tests only with CSSC
	else
		TESTING_CSSC=true # We run additional tests
	fi
	TESTING_REAL_SCCS=true	# Run tests e.g. for SCCS date extensions
fi

#
# As the test scripts do not include methods to switch between v4 and v6,
# we here check whether "admin" by default creates SCCSv6 history files.
# This may be caused by an admin program that really creates v6 by default
# or by an admin program that was told to create v6 by adding the environment
# SCCS_V6
#
rm -f s.v6-test
${admin} -n s.v6-test
if head -1 s.v6-test | grep '^hV6,' > /dev/null
then
	TESTING_SCCS_V6=true	# Software supports SCCSv6, so test it
fi
rm -f s.v6-test
