1 |
786 |
skrzyp |
#===============================================================================
|
2 |
|
|
#
|
3 |
|
|
# default.exp
|
4 |
|
|
#
|
5 |
|
|
# Support for host-side testing
|
6 |
|
|
#
|
7 |
|
|
#===============================================================================
|
8 |
|
|
# ####ECOSHOSTGPLCOPYRIGHTBEGIN####
|
9 |
|
|
# -------------------------------------------
|
10 |
|
|
# This file is part of the eCos host tools.
|
11 |
|
|
# Copyright (C) 1998, 1999, 2000 Free Software Foundation, Inc.
|
12 |
|
|
#
|
13 |
|
|
# This program is free software; you can redistribute it and/or modify
|
14 |
|
|
# it under the terms of the GNU General Public License as published by
|
15 |
|
|
# the Free Software Foundation; either version 2 or (at your option) any
|
16 |
|
|
# later version.
|
17 |
|
|
#
|
18 |
|
|
# This program is distributed in the hope that it will be useful, but
|
19 |
|
|
# WITHOUT ANY WARRANTY; without even the implied warranty of
|
20 |
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
21 |
|
|
# General Public License for more details.
|
22 |
|
|
#
|
23 |
|
|
# You should have received a copy of the GNU General Public License
|
24 |
|
|
# along with this program; if not, write to the
|
25 |
|
|
# Free Software Foundation, Inc., 51 Franklin Street,
|
26 |
|
|
# Fifth Floor, Boston, MA 02110-1301, USA.
|
27 |
|
|
# -------------------------------------------
|
28 |
|
|
# ####ECOSHOSTGPLCOPYRIGHTEND####
|
29 |
|
|
#===============================================================================
|
30 |
|
|
######DESCRIPTIONBEGIN####
|
31 |
|
|
#
|
32 |
|
|
# Author(s): bartv
|
33 |
|
|
# Contributors: bartv
|
34 |
|
|
# Date: 1998-11-24
|
35 |
|
|
#
|
36 |
|
|
#####DESCRIPTIONEND####
|
37 |
|
|
#===============================================================================
|
38 |
|
|
#
|
39 |
|
|
|
40 |
|
|
# The host-side infrastructure tests will only run on the hosts, i.e.
|
41 |
|
|
# only native testing is possible.
|
42 |
|
|
if { [isnative] != 1 } {
|
43 |
|
|
perror "Only native testing is supported."
|
44 |
|
|
exit 1
|
45 |
|
|
}
|
46 |
|
|
|
47 |
|
|
# Most of the test harness lives in a file hosttest.exp. This is part
|
48 |
|
|
# of the host-side infrastructure and gets installed in the directory
|
49 |
|
|
# $(PREFIX)/share/dejagnu. Other packages have to locate the file
|
50 |
|
|
# the hard way since the PREFIX is not provided automatically in
|
51 |
|
|
# the site.exp file, instead it is necessary to search through the
|
52 |
|
|
# build tree's Makefile. In the case of the infrastructure itself
|
53 |
|
|
# a shortcut is both possible and desirable because the script may
|
54 |
|
|
# not have been installed yet.
|
55 |
|
|
#
|
56 |
|
|
# Note that srcdir actually points at the testsuite subdirectory, not
|
57 |
|
|
# at the real srcdir.
|
58 |
|
|
set filename [file join $::srcdir .. hosttest.exp]
|
59 |
|
|
set status [ catch { source $filename } message]
|
60 |
|
|
if { $status != 0 } {
|
61 |
|
|
perror ("Unexpected error while reading in the support script $filename\n$message"
|
62 |
|
|
}
|
63 |
|
|
|
64 |
|
|
# Now that the hosttest.exp utilities are available it is possible to do
|
65 |
|
|
# a bit more initialization. In particular it is possible to read in the
|
66 |
|
|
# build tree's Makefile and look for definitions of CC, CXX, and any
|
67 |
|
|
# other information from the Makefile that may prove useful.
|
68 |
|
|
hosttest_initialize
|
69 |
|
|
|
70 |
|
|
# There are standard routines ${tool}_start, ${tool}_load, ${tool}_exit
|
71 |
|
|
# and ${tool}_version which test harnesses should normally implement.
|
72 |
|
|
# In practice runtest only invokes ${tool}_exit and ${tool}_version
|
73 |
|
|
# directly, the rest may or may not be invoked from inside the individual
|
74 |
|
|
# test scripts.
|
75 |
|
|
#
|
76 |
|
|
# ${tool}_version is relatively straightforward. The master version
|
77 |
|
|
# number is maintained in the configure.in script and is exported to
|
78 |
|
|
# the build tree's Makefile. There is a hosttest routine which does the
|
79 |
|
|
# hard work because getting the information is common to all host
|
80 |
|
|
# packages. The _version routine itself cannot be made completely generic
|
81 |
|
|
# because the first output is package-specific.
|
82 |
|
|
|
83 |
|
|
proc ${tool}_version { } {
|
84 |
|
|
|
85 |
|
|
set status [ catch { hosttest_extract_version } message]
|
86 |
|
|
if { $status != 0 } {
|
87 |
|
|
perror $message
|
88 |
|
|
return
|
89 |
|
|
}
|
90 |
|
|
clone_output "[file join $::objdir libcyginfra.a] $message"
|
91 |
|
|
}
|
92 |
|
|
|
93 |
|
|
# ${tool}_start does not serve any useful purpose when it comes to
|
94 |
|
|
# testing libcyginfra.a - there is no tool which can be started up.
|
95 |
|
|
# Therefore none of the individual test scripts will invoke this
|
96 |
|
|
# routine.
|
97 |
|
|
|
98 |
|
|
proc ${tool}_start { } {
|
99 |
|
|
perror "Cyginfra is a library, not a tool, and cannot be started."
|
100 |
|
|
}
|
101 |
|
|
|
102 |
|
|
# ${tool}_load is used to load a test case into the tool. The exact
|
103 |
|
|
# meaning is not applicable. However it makes sense to have this
|
104 |
|
|
# routine provide an alias for hosttest_run_simple_test which provides
|
105 |
|
|
# all the libraries etc. that are going to be needed.
|
106 |
|
|
|
107 |
|
|
proc ${tool}_load { program { args ""} } {
|
108 |
|
|
hosttest_run_simple_test $program {} {} {} cyginfra $args
|
109 |
|
|
}
|
110 |
|
|
|
111 |
|
|
# ${tool}_exit does not serve any useful purpose here.
|
112 |
|
|
proc ${tool}_exit { } {
|
113 |
|
|
}
|