[gdb/testsuite] Fix infoline-reloc-main-from-zero.exp compilation
[deliverable/binutils-gdb.git] / gdb / testsuite / gdb.python / py-typeprint.exp
1 # Copyright (C) 2012-2019 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 this program. If not, see <http://www.gnu.org/licenses/>.
15
16 if { [skip_cplus_tests] } { continue }
17
18 load_lib gdb-python.exp
19 load_lib cp-support.exp
20
21 standard_testfile .cc
22
23 if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} {
24 return -1
25 }
26
27 if { [skip_python_tests] } { continue }
28
29 set remote_python_file [gdb_remote_download host \
30 ${srcdir}/${subdir}/${testfile}.py]
31
32 gdb_test_no_output "source ${remote_python_file}" "load python file"
33
34 cp_test_ptype_class s "basic test" "class" "templ<string>" {
35 { field public "T x;" }
36 { field public "templ<T> *value;" }
37 } "" {} ""
38
39 cp_test_ptype_class s "raw test" "class" "templ<basic_string>" {
40 { field public "basic_string x;" }
41 { field public "templ<basic_string> *value;" }
42 } "" {} "/r"
43
44 gdb_test_no_output "disable type-printer string"
45 gdb_test "whatis bs" "basic_string" "whatis with disabled printer"
46
47 gdb_test "info type-printers" "Global type printers:.*string.*disabled.*"
48
49 gdb_test_no_output "enable type-printer string"
50 gdb_test "whatis bs" "string" "whatis with enabled printer"
51
52 gdb_test "whatis s" "templ<string>"
This page took 0.031668 seconds and 4 git commands to generate.