1 #===============================================================================
5 # Support for host-side testing
7 #===============================================================================
8 ######COPYRIGHTBEGIN####
10 # ----------------------------------------------------------------------------
11 # Copyright (C) 1998, 1999, 2000, 2001 Red Hat, Inc.
13 # This file is part of the eCos host tools.
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)
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
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.
29 # ----------------------------------------------------------------------------
31 ######COPYRIGHTEND####
32 #===============================================================================
33 ######DESCRIPTIONBEGIN####
39 #####DESCRIPTIONEND####
40 #===============================================================================
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."
50 # Most of the test harness lives in a file hosttest.exp. This is part
51 # of the host-side infrastructure.
53 set filename [file join $::srcdir "../../infra/hosttest.exp"]
54 set status [ catch { source $filename } message]
56 perror "Unexpected error while reading in the support script $filename\n$message"
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.
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
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.
79 proc ${tool}_version { } {
81 set status [ catch { hosttest_extract_version } message]
86 clone_output "[file join $::objdir libcdl.a] $message"
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
94 proc ${tool}_start { } {
95 perror "CDL is a library, not a tool, and cannot be started."
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.
103 proc ${tool}_load { program { args ""} } {
104 hosttest_run_simple_test $program {} [list] [list] [list "cdl"] $args
107 # ${tool}_exit does not serve any useful purpose here.
108 proc ${tool}_exit { } {