1#! /bin/sh -f
2# ``Licensed under the Apache License, Version 2.0 (the "License");
3# you may not use this file except in compliance with the License.
4# You may obtain a copy of the License at
5#
6#     http://www.apache.org/licenses/LICENSE-2.0
7#
8# Unless required by applicable law or agreed to in writing, software
9# distributed under the License is distributed on an "AS IS" BASIS,
10# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11# See the License for the specific language governing permissions and
12# limitations under the License.
13#
14# The Initial Developer of the Original Code is Ericsson Utvecklings AB.
15# Portions created by Ericsson are Copyright 1999, Ericsson Utvecklings
16# AB. All Rights Reserved.''
17#
18#     $Id$
19#
20#
21# Author: Hakan Mattsson <hakan@erix.ericsson.se>
22# Purpose: Simplified execution of the test suite
23#
24# Usage: mt <args to erlang startup script>
25
26#top=".."
27top="$ERL_TOP/lib/mnesia"
28h=`hostname`
29p="-pa $top/examples -pa $top/ebin -pa $top/test -mnesia_test_verbose true"
30log=test_log$$
31latest=test_log_latest
32args=${1+"$@"}
33erlcmd="erl -sname a $p $args -mnesia_test_timeout"
34erlcmd1="erl -sname a1 $p $args"
35erlcmd2="erl -sname a2 $p $args"
36
37if test z"$MT_TERM" = z ; then
38    MT_TERM=xterm
39fi
40
41case $MT_TERM in
42    xterm)
43	geom0="-geometry 142x40+0+0"
44	geom1="-geometry 70x20+0+550"
45	geom2="-geometry 70x20+480+550"
46	title="-T"
47	exec="-e"
48	;;
49    gnome-terminal)
50	geom0="--geometry 142x40+0+0"
51	geom1="--geometry 70x20+0+740"
52	geom2="--geometry 70x20+700+740"
53	title="--title"
54	exec="--hide-menubar --"
55	;;
56    *rxvt)
57	geom0="-geometry 142x40+0+0"
58	geom1="-geometry 70x20+0+680"
59	geom2="-geometry 70x20+630+680"
60	title="-title"
61	exec="-e"
62esac
63
64$MT_TERM $geom1 $title a1 $exec $erlcmd1 &
65$MT_TERM $geom2 $title a2 $exec $erlcmd2 &
66
67rm "$latest" 2>/dev/null
68ln -s "$log" "$latest"
69touch "$log"
70
71echo "$erlcmd1"
72echo ""
73echo "$erlcmd2"
74echo ""
75echo "$erlcmd"
76echo ""
77echo "Give the following command in order to see the outcome from node a@$h"":"
78echo ""
79echo "	less test_log$$"
80
81$MT_TERM $geom0 $title a $exec script -f -c "$erlcmd" "$log"  &
82tail -f "$log" | egrep 'Eval|<>ERROR|NYI'
83
84