aboutsummaryrefslogtreecommitdiff
path: root/testsuite/libdejagnu/tunit.exp
blob: 41c9c27dabb491d9273d9a097ad66b1b3d84ac9c (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
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
# 2001, 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 2 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.

load_lib "dejagnu.exp"

# Uncomment these for debugging help
#strace $tracelevel
# exp_internal -f dbg.log 1

# Get the size of the module being tested.
set sizes [exe_size "unit"]
if {[lindex $sizes 0] == "-1"} {
    perror "Couldn't get the object file size" 0
}

# Extract the text section size
set textsize [lindex $sizes 0]

# Extract the data section size
set datasize [lindex $sizes 1]

# FIXME: This ultimately needs to be recorded in the testing database,
# which doesn't exist yet. Till then it's kinda bogus, but I figured
# it would be useful having working code to get this data. So we print
# it out, just for the demo aspects.
verbose "Text section size of proctor is 0x$textsize"
verbose "Data section size of proctor is 0x$datasize"

# Execute the test case, and analyse the output
if { [host_execute "unit"] != "" } {
    perror "unit had an execution error" 0
}