1#!/bin/sh -
2#	$Id$
3#
4# Build the Tcl test files.
5
6msg1="# Automatically built by dist/s_test; may require local editing."
7msg2="# Automatically built by dist/s_test; may require local editing."
8
9t=/tmp/__t
10trap 'rm -f $t; exit 0' 0 1 2 3 13 15
11
12. RELEASE
13
14(echo "$msg1"					&& \
15 echo ""					&& \
16 echo "set tclsh_path @TCL_TCLSH@"		&& \
17 echo "set tcllib .libs/libdb_tcl-@DB_VERSION_MAJOR@.@DB_VERSION_MINOR@@LIBTSO_MODSUFFIX@" && \
18 echo ""					&& \
19 echo "set rpc_server localhost"	 	&& \
20 echo "set rpc_path ."			 	&& \
21 echo "set rpc_testdir \$rpc_path/TESTDIR"	&& \
22 echo ""					&& \
23 echo "set src_root @srcdir@/.."		&& \
24 echo "set test_path @srcdir@/../test"		&& \
25 echo "set je_root @srcdir@/../../je"		&& \
26 echo ""					&& \
27 echo "global testdir"				&& \
28 echo "set testdir ./TESTDIR"			&& \
29 echo ""					&& \
30 echo "global dict"				&& \
31 echo "global util_path"			&& \
32 echo ""					&& \
33 echo "global is_freebsd_test"			&& \
34 echo "global is_hp_test"			&& \
35 echo "global is_linux_test"			&& \
36 echo "global is_qnx_test"			&& \
37 echo "global is_sunos_test"			&& \
38 echo "global is_windows_test"			&& \
39 echo "global is_windows9x_test"		&& \
40 echo ""					&& \
41 echo "global valid_methods"			&& \
42 echo "global checking_valid_methods"		&& \
43 echo "global test_recopts"			&& \
44 echo ""					&& \
45 echo "set KILL \"@KILL@\"") > $t
46
47f=../test/include.tcl
48cmp $t $f > /dev/null 2>&1 ||
49    (echo "Building $f" && rm -f $f && cp $t $f && chmod 444 $f)
50
51(echo "$msg1"					&& \
52 echo ""					&& \
53 echo "set tclsh_path SET_YOUR_TCLSH_PATH"	&& \
54 echo "set buildpath Win32/Debug"	&& \
55 echo "set tcllib libdb_tcl${DB_VERSION_MAJOR}${DB_VERSION_MINOR}d.dll" && \
56 echo ""					&& \
57 echo "set src_root .."				&& \
58 echo "set test_path ../test"			&& \
59 echo "set je_root ../../je"			&& \
60 echo ""					&& \
61 echo "global testdir"				&& \
62 echo "set testdir ./TESTDIR"			&& \
63 echo ""					&& \
64 echo "global dict"				&& \
65 echo "global util_path"			&& \
66 echo ""					&& \
67 echo "global is_freebsd_test"			&& \
68 echo "global is_hp_test"			&& \
69 echo "global is_linux_test"			&& \
70 echo "global is_qnx_test"			&& \
71 echo "global is_sunos_test"			&& \
72 echo "global is_windows_test"			&& \
73 echo "global is_windows9x_test"		&& \
74 echo ""					&& \
75 echo "global valid_methods"			&& \
76 echo "global checking_valid_methods"		&& \
77 echo "global test_recopts"			&& \
78 echo ""					&& \
79 echo "set KILL dbkill.exe") > $t
80
81f=../build_windows/include.tcl
82cmp $t $f > /dev/null 2>&1 ||
83    (echo "Building $f" && rm -f $f && cp $t $f && chmod 444 $f)
84
85# Build the test directory TESTS file.
86(echo $msg2;
87cat `egrep -l '^#[	 ][	 ]*TEST' ../test/*.tcl` |
88sed -e '/^#[	 ][	 ]*TEST/!{' \
89    -e 's/.*//' \
90    -e '}' |
91cat -s |
92sed -e '/TEST/{' \
93    -e 's/^#[	 ][	 ]*TEST[	 ]*//' \
94    -e 's/^	//' \
95    -e 'H' \
96    -e 'd' \
97    -e '}' \
98    -e 's/.*//' \
99    -e x \
100    -e 's/\n/__LINEBREAK__/g' |
101sort |
102sed -e 's/__LINEBREAK__/\
103=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\
104/' \
105    -e 's/__LINEBREAK__/\
106	/g' |
107sed -e 's/^[	 ][	 ]*$//') > $t
108
109f=../test/TESTS
110cmp $t $f > /dev/null 2>&1 ||
111    (echo "Building $f" && rm -f $f && cp $t $f && chmod 444 $f)
112