#!/bin/sh -
#	$Id: s_test,v 1.14 2005/04/21 21:08:02 gmf Exp $
#
# Build the Tcl test files.

msg1="# Automatically built by dist/s_test; may require local editing."

t=/tmp/__t
trap 'rm -f $t; exit 0' 0 1 2 3 13 15

. RELEASE

(echo "$msg1"					&& \
 echo ""					&& \
 echo "set tclsh_path @TCL_TCLSH@"		&& \
 echo ""					&& \
 echo "set src_root .."				&& \
 echo "set test_path \$src_root/test"		&& \
 echo "source \$test_path/globals.tcl"		&& \
 echo ""					&& \
 echo "set dbxml_tcllib .libs/libdbxml_tcl-@DBXML_VERSION_MAJOR@.@DBXML_VERSION_MINOR@@LIBTSO_MODSUFFIX@" && \
 echo ""					&& \
 echo "set db_tcllib @DB_TCLLIB@@LIBTSO_MODSUFFIX@" && \
 echo "set db_test_path @DB_TEST_PATH@"		&& \
 echo "set db_util_path @DB_UTIL_PATH@"		&& \
 echo "set xmlutil_path ."			&& \
 echo "set xmltest_path ."			&& \
 echo ""					&& \
 echo "set KILL \"@db_cv_path_kill@\"") > $t

f=../test/include.tcl
cmp $t $f > /dev/null 2>&1 ||
    (echo "Building $f" && rm -f $f && cp $t $f && chmod 444 $f)


(echo "$msg1"					&& \
 echo ""					&& \
 echo "set tclsh_path SET_YOUR_TCLSH_PATH"	&& \
 echo ""					&& \
 echo "set src_root .."				&& \
 echo "set test_path \$src_root/test"		&& \
 echo "source \$test_path/globals.tcl"		&& \
 echo ""					&& \
 echo "set dbxml_tcllib ../../bin/debug/libdbxml_tcl${DBXML_VERSION_MAJOR}${DBXML_VERSION_MINOR}d.dll" && \
 echo "set db_tcllib @DB_TCLLIB@" && \
 echo "set db_test_path @DB_TEST_PATH@"		&& \
 echo "set db_util_path @DB_UTIL_PATH@"		&& \
 echo "set xmltest_path ./Debug"                && \
 echo "set xmlutil_path ../../bin/debug"	&& \
 echo ""					&& \
 echo "set KILL \$db_util_path/dbkill.exe") | sed -f lib_paths.sed > $t

f=../build_win32/include.tcl
cmp $t $f > /dev/null 2>&1 ||
    (echo "Building $f" && rm -f $f && cp $t $f && chmod 444 $f)
