Debian Codegraph @

libgo/testsuite/lib/libgo.exp

raw
1 # Copyright (C) 2010 Free Software Foundation, Inc.
2
3 # This program is free software; you can redistribute it and/or modify
4 # it under the terms of the GNU General Public License as published by
5 # the Free Software Foundation; either version 3 of the License, or
6 # (at your option) any later version.
7 #
8 # This program is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 # GNU General Public License for more details.
12 #
13 # You should have received a copy of the GNU General Public License
14 # along with GCC; see the file COPYING3. If not see
15 # <http://www.gnu.org/licenses/>.
16
17 set TESTING_IN_BUILD_TREE 1
18
19 if ![info exists GOC_UNDER_TEST] then {
20 set gccdir [lookfor_file $tool_root_dir gcc/libgcc.a]
21 if {$gccdir != ""} {
22 set gccdir [file dirname $gccdir]
23 }
24 set GOC_UNDER_TEST "$gccdir/gccgo -B$gccdir/"
25 }
26
27 if [info exists GOTEST_TMPDIR] {
28 set tmpdir $GOTEST_TMPDIR
29 }
30
31 proc go_maybe_build_wrapper { args } {
32 libgo_maybe_build_wrapper $args
33 }
34
35 # DejaGnu does not have proper library search paths for load_lib.
36 # We have to explicitly load everything that go.exp wants to load.
37
38 proc load_gcc_lib { filename } {
39 global srcdir loaded_libs
40
41 load_file $srcdir/../../gcc/testsuite/lib/$filename
42 set loaded_libs($filename) ""
43 }
44
45 load_gcc_lib multiline.exp
46 load_gcc_lib prune.exp
47 load_gcc_lib target-libpath.exp
48 load_gcc_lib wrapper.exp
49 load_gcc_lib target-supports.exp
50 load_gcc_lib target-utils.exp
51 load_gcc_lib gcc-defs.exp
52 load_gcc_lib timeout.exp
53 load_gcc_lib go.exp
54
55 proc libgo_init { args } {
56 global TESTING_IN_BUILD_TREE
57 if { [info exists TESTING_IN_BUILD_TREE] } {
58 # If '--with-build-sysroot=[...]' was specified, use it for build-tree
59 # testing.
60 global TEST_ALWAYS_FLAGS SYSROOT_CFLAGS_FOR_TARGET
61 set TEST_ALWAYS_FLAGS $SYSROOT_CFLAGS_FOR_TARGET
62 }
63
64 go_init $args
65 }