view dist/s_test @ 0:a1985f14b030

Initial load
author chegar
date Fri, 11 May 2012 10:42:02 +0100
parents
children
line wrap: on
line source

#!/bin/sh -
#
# Copyright (c) 2012 Oracle and/or its affiliates.  All rights reserved.
# 
#  DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
# 
#  This code is free software; you can redistribute it and/or modify it
#  under the terms of the GNU General Public License version 2 only, as
#  published by the Free Software Foundation.  Oracle designates this
#  particular file as subject to the "Classpath" exception as provided
#  by Oracle in the LICENSE file that accompanied this code.
# 
#  This code is distributed in the hope that it will be useful, but WITHOUT
#  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
#  FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
#  version 2 for more details (a copy is included in the LICENSE file that
#  accompanied this code).
# 
#  You should have received a copy of the GNU General Public License version
#  2 along with this work; if not, write to the Free Software Foundation,
#  Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
# 
#  Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
#  or visit www.oracle.com if you need additional information or have any
#  questions.
#
#	$Id$
#
# Build the Tcl test files.

msg1="# Automatically built by dist/s_test; may require local editing."
msg2="# 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 "set tcllib .libs/libdb_tcl-@DB_VERSION_MAJOR@.@DB_VERSION_MINOR@@LIBTSO_MODSUFFIX@" && \
 echo ""					&& \
 echo "set src_root @srcdir@/.."		&& \
 echo "set test_path @srcdir@/../test/tcl"	&& \
 echo "set je_root @srcdir@/../../je"		&& \
 echo "set tcl_utils @srcdir@/../test/tcl_utils"	&& \
 echo ""					&& \
 echo "global testdir"				&& \
 echo "set testdir ./TESTDIR"			&& \
 echo ""					&& \
 echo "global dict"				&& \
 echo "global util_path"			&& \
 echo ""					&& \
 echo "global is_freebsd_test"			&& \
 echo "global is_hp_test"			&& \
 echo "global is_linux_test"			&& \
 echo "global is_osx_test"			&& \
 echo "global is_qnx_test"			&& \
 echo "global is_sunos_test"			&& \
 echo "global is_windows_test"			&& \
 echo "global is_windows9x_test"		&& \
 echo ""					&& \
 echo "global valid_methods"			&& \
 echo "global checking_valid_methods"		&& \
 echo "global test_recopts"			&& \
 echo ""					&& \
 echo "set KILL \"@KILL@\"") > $t

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

(echo "$msg1"					&& \
 echo ""					&& \
 echo "set tclsh_path SET_YOUR_TCLSH_PATH"	&& \
 echo "set buildpath Win32/Debug"	&& \
 echo "set tcllib libdb_tcl${DB_VERSION_MAJOR}${DB_VERSION_MINOR}d.dll" && \
 echo ""					&& \
 echo "set src_root .."				&& \
 echo "set test_path ../test/tcl"		&& \
 echo "set je_root ../../je"			&& \
 echo "set tcl_utils ../test/tcl_utils"		&& \
 echo ""					&& \
 echo "global testdir"				&& \
 echo "set testdir ./TESTDIR"			&& \
 echo ""					&& \
 echo "global dict"				&& \
 echo "global util_path"			&& \
 echo ""					&& \
 echo "global is_freebsd_test"			&& \
 echo "global is_hp_test"			&& \
 echo "global is_linux_test"			&& \
 echo "global is_osx_test"			&& \
 echo "global is_qnx_test"			&& \
 echo "global is_sunos_test"			&& \
 echo "global is_windows_test"			&& \
 echo "global is_windows9x_test"		&& \
 echo ""					&& \
 echo "global valid_methods"			&& \
 echo "global checking_valid_methods"		&& \
 echo "global test_recopts"			&& \
 echo ""					&& \
 echo "set KILL dbkill.exe") > $t

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

# Build the test directory TESTS file.
(echo $msg2;
cat `egrep -l '^#[	 ][	 ]*TEST' ../test/tcl/*.tcl` |
sed -e '/^#[	 ][	 ]*TEST/!{' \
    -e 's/.*//' \
    -e '}' |
cat -s |
sed -e '/TEST/{' \
    -e 's/^#[	 ][	 ]*TEST[	 ]*//' \
    -e 's/^	//' \
    -e 'H' \
    -e 'd' \
    -e '}' \
    -e 's/.*//' \
    -e x \
    -e 's/\n/__LINEBREAK__/g' |
LANG=C sort |
sed -e 's/__LINEBREAK__/\
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\
/' \
    -e 's/__LINEBREAK__/\
	/g' |
sed -e 's/^[	 ][	 ]*$//') > $t

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