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