aboutsummaryrefslogtreecommitdiff
path: root/testsuite/runtest.all/options.exp
blob: 0bfcfecaa0f6daf7cad8326531549de1614c2b02 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
# 20001, 2002, 2003 Free Software Foundation, Inc.
#
# This file is part of DejaGnu.
#
# DejaGnu is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# DejaGnu 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 for more details.
#
# You should have received a copy of the GNU General Public License
# along with DejaGnu; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.

# This file was written by Rob Savoye <rob@welcomehome.org>.

load_lib util-defs.exp

# move the site.exp file so we have no default to confuse us.
#if [file exists $objdir/site.exp] {
#    catch "exec mv -f $objdir/site.exp $objdir/site.ignore"
#}
set fd [open site.exp w]
puts ${fd} "set host_triplet $host_triplet"
puts ${fd} "set srcdir $srcdir/.."
puts ${fd} "set objdir $objdir/.."
puts ${fd} "set tmpdir $objdir/../tmpdir"
close $fd

#
# Set up the list.
# 1st field is the command line option.
# 2nd field is the pattern to match.
#	NOTE - No variable substitutions can be used.
# 3rd field is an optional message to print with PASS/FAIL.
#


set tests {
    { "-v --tool xXx" "Found.*site\..*Loading.*utils\.exp" "Loading library files" }
    { "-v --tool xXx" "Expect binary is.*Using.*main test driver" "Loading basic packages" }
    { "--F --tool x" "Illegal Argument \"--F\"" "Bad argument" }
    { "--tool x" "Couldn't find tool init file" "Bad tool name" }
    { "--help" "USAGE:*" "Display help" }
    { "-v -v -v" "Verbose level is 3" "Verbose set correctly" }
    { "-V" "Expect version is.*Tcl version is.*Framework version is*" "--version" }
    { "-v --target m68k-vxworks" "Target is m68k-vxworks" "--target option" }
    { "-v --host sparc-sun-sunos4.1.9" "Native configuration is sparc-sun-sunos4.1.9" "--host option" }
    { "-v -a" "Print all test output to screen" "--all option" }
    { "-v --objdir xXx" "Using test binaries in xXx" "--objdir option" }
    { "-v --tool xXx" "Testing xXx" "--tool option" }
    { "-v --debug" "Expect Debugging is ON" "--debug option" }
    { "-v --D0" "Tcl debugger is ON" "--D0 option" }
}

# Commented out for now--this is failing because of a TCL8 strace interaction.
#    { "-v --strace 1" "Source Trace level is now 1.* 1  if" "--strace option" }


# Old tests not used anymore
#    { "-v --build sparc-sun-sunos4.1.9" "Native configuration is sparc-sun-sunos4.1.9" "--build option" }
#    { "-v --srcdir xXx" "Using test sources in xXx" "--srcdir option" }

foreach i $tests {
    if [util_test "$RUNTEST" "[lindex $i 0] -srcdir ${srcdir}/runtest.all" "" "[lindex $i 1]"] {
        fail "[lindex $i 2]"
    } else {
        pass "[lindex $i 2]"
    }
}


set fd [open site.exp w]
puts ${fd} "set host_triplet $host_triplet"
puts ${fd} "set srcdir $srcdir"
puts ${fd} "set objdir $objdir"
puts ${fd} "set tmpdir $objdir/tmpdir"
close $fd

# clean up log files left by the child runtest
if [file exists $objdir/x.sum] {
    exec rm -f $objdir/x.*
}
if [file exists $objdir/xXx.sum] {
    exec rm -f $objdir/xXx.*
}