OSDN Git Service

Make using DejaGNU work for libgo testing on a native system.
[pf3gnuchains/gcc-fork.git] / libgo / testsuite / lib / libgo.exp
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 gccdir [lookfor_file $tool_root_dir gcc/libgcc.a]
18 if {$gccdir != ""} {
19     set gccdir [file dirname $gccdir]
20 }
21 set GOC_UNDER_TEST "$gccdir/gccgo -B$gccdir/"
22 set TESTING_IN_BUILD_TREE 1
23
24 proc go_maybe_build_wrapper { args } {
25     libgo_maybe_build_wrapper $args
26 }
27
28 # DejaGnu does not have proper library search paths for load_lib.
29 # We have to explicitly load everything that go.exp wants to load.
30
31 proc load_gcc_lib { filename } {
32     global srcdir loaded_libs
33
34     load_file $srcdir/../../gcc/testsuite/lib/$filename
35     set loaded_libs($filename) ""
36 }
37
38 load_gcc_lib prune.exp
39 load_gcc_lib target-libpath.exp
40 load_gcc_lib wrapper.exp
41 load_gcc_lib gcc-defs.exp
42 load_gcc_lib go.exp
43
44 proc libgo_init { args } {
45     go_init $args
46 }