1 # test configuration support -*- Tcl -*-
3 # Copyright (C) 1996-2019, 2020 Free Software Foundation, Inc.
5 # This file is part of DejaGnu.
7 # DejaGnu is free software; you can redistribute it and/or modify it
8 # under the terms of the GNU General Public License as published by
9 # the Free Software Foundation; either version 3 of the License, or
10 # (at your option) any later version.
12 # DejaGnu is distributed in the hope that it will be useful, but
13 # WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 # General Public License for more details.
17 # You should have received a copy of the GNU General Public License
18 # along with DejaGnu; if not, write to the Free Software Foundation,
19 # Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
21 if [ file exists $srcdir/$subdir/default_procs.tcl ] {
22 source $srcdir/$subdir/default_procs.tcl
24 puts "ERROR: $srcdir/$subdir/default_procs.tcl doesn't exist"
26 if [ file exists $srcdir/../lib/framework.exp] {
27 source $srcdir/../lib/framework.exp
29 puts "ERROR: $srcdir/../lib/framework.exp doesn't exist"
34 set host_triplet i586-unknown-linux
35 set target_triplet i586-unknown-linux
38 set build_triplet i586-unknown-linux
41 # Tests for a native configuration
44 { lib_bool_test isbuild {$build_triplet} true
46 { lib_bool_test isbuild {$target_cpu-*-$target_os} true
47 "isbuild, native regexp" }
48 { lib_bool_test isbuild {hppa-ibm-macos} false
49 "isbuild, native bogus config string" }
51 { "#" "test default argument for isbuild" }
52 { lib_ret_test isbuild {} $build_triplet
53 "isbuild with no arguments" }
55 { "#" "ishost tests" }
56 { lib_bool_test ishost {$host_triplet} true
58 { lib_bool_test ishost {$target_cpu-*-$target_os} true
59 "ishost, native regexp" }
60 { lib_bool_test ishost {hppa-ibm-macos} false
61 "ishost, native bogus config string" }
63 { "#" "test default argument for ishost" }
64 { lib_ret_test ishost {} $host_triplet
65 "ishost with no arguments" }
67 { "#" "istarget tests" }
68 { lib_bool_test istarget {$target_triplet} true
70 { lib_bool_test istarget {$target_cpu-*-$target_os} true
71 "istarget, native regexp" }
72 { lib_bool_test istarget {hppa-ibm-macos} false
73 "istarget, native bogus config string" }
75 { "#" "test default argument for istarget" }
76 { lib_ret_test istarget {} $target_triplet
77 "istarget with no arguments" }
81 { lib_bool_test isnative {} true "isnative, native" }
82 { lib_bool_test is3way {} false "is3way, native" }
86 # Tests for a normal cross configuration
88 set target_triplet m68k-unknown-elf
90 { lib_bool_test isnative {} false "isnative, cross" }
91 { lib_bool_test is3way {} false "is3way, cross" }
95 # Tests for a canadian cross configuration
97 set host_triplet i386-unknown-winnt
99 { lib_bool_test isnative {} false "isnative, canadian cross" }
100 { lib_bool_test is3way {} true "is3way, canadian cross" }
103 puts "END config.test"