File: default.exp

package info (click to toggle)
binutils 2.46-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 417,664 kB
  • sloc: ansic: 1,487,508; asm: 829,455; cpp: 216,692; exp: 80,524; makefile: 73,157; sh: 24,213; yacc: 15,060; lisp: 13,632; perl: 13,404; lex: 1,714; ada: 1,681; pascal: 1,446; cs: 879; python: 637; java: 478; sed: 191; xml: 95; awk: 25
file content (71 lines) | stat: -rw-r--r-- 2,606 bytes parent folder | download | duplicates (4)
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
# Basic expect script for gprofng tests
#   Copyright (C) 2021-2026 Free Software Foundation, Inc.
#
# This file is part of the GNU Binutils.
#
# This file 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.
#
# This program 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 this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
# MA 02110-1301, USA.
#


# The "make check" target in the Makefile passes in
# "CC=$(CC_FOR_TARGET)".  But, if the user invokes runtest directly,
# these flags may not be set.
if {![info exists CC]} {
    set CC [find_gcc]
}
if {![info exists CC_FOR_TARGET]} {
    set CC_FOR_TARGET $CC
}
if {![info exists CFLAGS]} {
    set CFLAGS "-g -O2"
}

remote_exec host "sh -c \"rm -rf tmpdir; mkdir -p tmpdir\""
if { "$CHECK_TARGET" == "check-install" } {
    set ::env(GPROFNG) "$PREFIX/bin/gprofng"
} else {
    set ld_library_path "${BUILDDIR}/src/.libs:${BUILDDIR}/libcollector/.libs"
    set orig_ld_library_path ""
    catch { set orig_ld_library_path $::env(LD_LIBRARY_PATH) }
    if [file exists "${BUILDDIR}/../bfd/.libs/libbfd.a"] {
        append ld_library_path ":${BUILDDIR}/../bfd/.libs"
    }
    if [file exists "${BUILDDIR}/../opcodes/.libs/libopcodes.a"] {
        append ld_library_path ":${BUILDDIR}/../opcodes/.libs"
    }
    if [file exists "${BUILDDIR}/../libsframe/.libs/libsframe.a"] {
        append ld_library_path ":${BUILDDIR}/../libsframe/.libs"
    }
    if [file exists "${BUILDDIR}/../libiberty/libiberty.a"] {
        append ld_library_path ":${BUILDDIR}/../libiberty"
    }

    set f [open "gprofng_wrapper" w+]
    puts $f "#!$BASH"
    puts $f "LD_LIBRARY_PATH=$ld_library_path:$orig_ld_library_path"
    puts $f "GPROFNG_SYSCONFDIR=$env(srcroot)/src"
    puts $f "GPROFNG_PRELOAD_LIBDIRS=$BUILDDIR/libcollector/.libs"
    puts $f "export LD_LIBRARY_PATH GPROFNG_SYSCONFDIR GPROFNG_PRELOAD_LIBDIRS"
    puts $f "${BUILDDIR}/src/gprofng \"\$@\""
    close $f
    file attributes gprofng_wrapper -permissions +rx
    set ::env(GPROFNG) "$BUILDDIR/gprofng_wrapper"
}
puts "### GPROFNG: $env(GPROFNG)"

set TEST_TIMEOUT 300

load_lib display-lib.exp