#!/bin/sh

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

. ../common/command-names

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 real SCCS 4 digit year extensions
TESTING_SCCS_V6=false		# Don't test SCCSv6 features

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} -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
