aboutsummaryrefslogtreecommitdiff
path: root/testsuite/runtest.libs/config.test
blob: 6fbbcf147f774ca6d57eb01f0d7bd561af225221 (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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
# test configuration support					-*- Tcl -*-
#
# Copyright (C) 1996-2019, 2020 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 3 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.

if [ file exists $srcdir/$subdir/default_procs.tcl ] {
    source $srcdir/$subdir/default_procs.tcl
} else {
    puts "ERROR: $srcdir/$subdir/default_procs.tcl doesn't exist"
}
if [ file exists $srcdir/../lib/framework.exp] {
    source $srcdir/../lib/framework.exp
} else {
    puts "ERROR: $srcdir/../lib/framework.exp doesn't exist"
}

set all_flag 1

set host_triplet i586-unknown-linux
set target_triplet i586-unknown-linux
set target_cpu i586
set target_os linux
set build_triplet i586-unknown-linux

#
# Tests for a native configuration
#
run_tests [subst {
    { lib_bool_test isbuild {$build_triplet} true
	"isbuild, native" }
    { lib_bool_test isbuild {$target_cpu-*-$target_os} true
	"isbuild, native regexp" }
    { lib_bool_test isbuild {hppa-ibm-macos} false
	"isbuild, native bogus config string" }

    { "#" "test default argument for isbuild" }
    { lib_ret_test isbuild {} $build_triplet
	"isbuild with no arguments" }

    { "#" "ishost tests" }
    { lib_bool_test ishost {$host_triplet} true
	"ishost, native" }
    { lib_bool_test ishost {$target_cpu-*-$target_os} true
	"ishost, native regexp" }
    { lib_bool_test ishost {hppa-ibm-macos} false
	"ishost, native bogus config string" }

    { "#" "test default argument for ishost" }
    { lib_ret_test ishost {} $host_triplet
	"ishost with no arguments" }

    { "#" "istarget tests" }
    { lib_bool_test istarget {$target_triplet} true
	"istarget, native" }
    { lib_bool_test istarget {$target_cpu-*-$target_os} true
	"istarget, native regexp" }
    { lib_bool_test istarget {hppa-ibm-macos} false
	"istarget, native bogus config string" }

    { "#" "test default argument for istarget" }
    { lib_ret_test istarget {} $target_triplet
	"istarget with no arguments" }
}]

run_tests {
    { lib_bool_test isnative {} true	"isnative, native" }
    { lib_bool_test is3way {} false	"is3way, native" }
}

#
# Tests for a normal cross configuration
#
set target_triplet m68k-unknown-elf
run_tests {
    { lib_bool_test isnative {} false	"isnative, cross" }
    { lib_bool_test is3way {} false	"is3way, cross" }
}

#
# Tests for a canadian cross configuration
#
set host_triplet  i386-unknown-winnt
run_tests {
    { lib_bool_test isnative {} false	"isnative, canadian cross" }
    { lib_bool_test is3way {} true	"is3way, canadian cross" }
}

puts "END config.test"