dejagnu-1.6.3/0000755000000000000000000000000014062534645010116 500000000000000dejagnu-1.6.3/baseboards/0000755000000000000000000000000014062534646012224 500000000000000dejagnu-1.6.3/baseboards/README0000644000000000000000000000133713407073624013024 00000000000000The files in this directory are used to describe the basic configuration of a board. (Note that we use "board" in its loosest sense, referring to either a target or host). The structure of these files is very similar, and I would suggest that you follow this when writing a new one. Two files need to be created for a given board; the appropriate file in this directory, and one in config/. The one in here is used to set up entries in the data array describing the board, while the one in devo/dejagnu/config is used to describe the actions used to actually communicate with the board. A third file (the site-specific machine file) can be used to describe any site-specific functionality, such as port numbers, serial devices, etc. dejagnu-1.6.3/baseboards/aarch64-sim.exp0000644000000000000000000000405413676762721014712 00000000000000# Copyright (C) 1997-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. # Load the generic configuration for this board. This will define a basic # set of routines used to communicate with the board. load_generic_config "sim" # No multilib flags needed by default. process_multilib_options "" # basic-sim.exp is a basic description for the standard Cygnus simulator. load_base_board_description "basic-sim" # The name of the directory in the build tree where the simulator lives. setup_sim aarch64 # The compiler used to build for this board. This has *nothing* to do # with what compiler is tested if we're testing gcc. set_board_info compiler "[find_gcc]" # The basic set of flags needed to build "hello world" for this # board. This board uses libgloss and newlib. set_board_info cflags "[libgloss_include_flags] [newlib_include_flags]" set_board_info ldflags "[libgloss_link_flags] [newlib_link_flags] -specs=rdimon.specs" # This board doesn't use a linker script. set_board_info ldscript "" # Don't set needs_status_wrapper, as it clobbers ldflags. # The simulator is returning the exit status properly. # Used by a few gcc.c-torture testcases to delimit how large the stack can # be. set_board_info gcc,stack_size 16384 # No support for signals. set_board_info gdb,nosignals 1 # More time is needed to compile PlumHall tests set_board_info gcc,timeout 800 dejagnu-1.6.3/baseboards/am33_2.0-libremote.exp0000644000000000000000000000320313676762721015771 00000000000000# Copyright (C) 1997-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. # This file is useful for gdb testing with libremote on an embedded linux # board. In this case a Matsushita ASB2305 AM33 v2.0 board. load_generic_config "libremote_server" process_multilib_options "" # The default compiler for this target. set_board_info compiler "am33_2.0-linux-gnu-gcc" # We will be using the standard GDB remote protocol set_board_info gdb_protocol "remote" # Use techniques appropriate to a stub set_board_info use_gdb_stub 1 set_board_info gdb,gdb_stub 1 # This gdbserver can only run a process once per session. set_board_info gdb,do_reload_on_run 1 # There's no support for argument-passing (yet). set_board_info noargs 1 # Can't do input (or output) in the current gdbserver. set_board_info gdb,noinferiorio 1 # Can't do hardware watchpoints, in general set_board_info gdb,no_hardware_watchpoints 1 # New set_board_info gdb,nosignals 1 dejagnu-1.6.3/baseboards/androideabi.exp0000644000000000000000000000670413676762721015141 00000000000000# Copyright (C) 2013-2016, 2019 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. process_multilib_options "" load_generic_config "adb" # We need this for find_gcc and *_include_flags/*_link_flags. load_base_board_description "adb" # We may need -mandroid. set_board_info cflags "-mandroid" set_board_info ldflags "-mandroid" # # load PROG to DEST and run it with ARGS using adb # proc adb_load { dest prog args } { # Default directory uses tmpfs, so it is the best place to run # tests to avoid excessive wear of flash. global android_tmp_dir if { $android_tmp_dir ne "" } { verbose -log "android temporary directory is set to $android_tmp_dir" 3 } else { set android_tmp_dir "/mnt/sdcard/.android_secure" verbose -log "android temporary directory will be used by default $android_tmp_dir" 3 } if { [llength $args] > 0 } { set pargs [lindex $args 0] } else { set pargs "" } if { [llength $args] > 1 } { set inp "[lindex $args 1]" } else { set inp "" } if {![file exists $prog]} then { # We call both here because this should never happen. perror "$prog does not exist in standard_load." verbose -log "$prog does not exist." 3 return "untested" } if {[isremote $dest]} { set localfile "./[file tail $prog].[pid]" set remotefile "$android_tmp_dir/[file tail $prog].[pid]" set remotefile [remote_download $dest $prog $remotefile] if { $remotefile eq "" } { verbose -log "Download of $prog to [board_info $dest name] failed." 3 return "unresolved" } set retval [remote_exec $dest "test -x $remotefile"] if { $retval ne "0 {}" } { # Android doesn't support symbolic input for chmod, therefore set executable permission by number set retval [remote_exec $dest "chmod 755 $remotefile"] if { $retval ne "0 {}" } { verbose -log "Setting executable permissions of $prog on [board_info $dest name] failed." 3 return "unresolved" } } if {[board_info $dest exists remote_link]} { if {[[board_info $dest remote_link] $remotefile]} { verbose -log "Couldn't do remote link" # Can't use remote_file delete since /system/bin/rm does not # support -f on Android. remote_exec $dest rm $remotefile return "unresolved" } } set status [remote_exec $dest $localfile $pargs $inp] remote_exec $dest rm $remotefile } else { set status [remote_exec $dest $prog $pargs $inp] } if { [lindex $status 0] < 0 } { verbose -log "Couldn't execute $prog, [lindex $status 1]" 3 return "unresolved" } set output [lindex $status 1] set status [lindex $status 0] verbose -log "Executed $prog, status $status" 2 if {$output ne ""} { verbose -log -- $output 2 } if { $status == 0 } { return [list "pass" $output] } else { return [list "fail" $output] } } dejagnu-1.6.3/baseboards/arm-ice.exp0000644000000000000000000000442313676762721014211 00000000000000# Copyright (C) 1997-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. # Load the generic configuration for this board. This will define a basic # set of routines used to communicate with the board. load_generic_config "gdb-comm" # No multilib flags needed by default. process_multilib_options "" if { [board_info $board obj_format] eq "pe" } { set additional_options "-Wl,-oformat,pe-arm-little,--image-base,0" } else { set additional_options "" } # basic-sim.exp is a basic description for the standard Cygnus simulator. # The compiler used to build for this board. This has *nothing* to do # with what compiler is tested if we're testing gcc. set_board_info compiler "[find_gcc]" # The basic set of flags needed to build "hello world" for this # board. This board uses libgloss and newlib. set_board_info cflags "[libgloss_include_flags] [newlib_include_flags]" set_board_info ldflags "[libgloss_link_flags] [newlib_link_flags] $additional_options" # This board doesn't use a linker script. set_board_info ldscript "" # Used by a few gcc.c-torture testcases to delimit how large the stack can # be. set_board_info gcc,stack_size 16384 # We use "target rdi" to talk to the board. set_board_info gdb_protocol "rdi" # No support for signals. set_board_info gdb,nosignals 1 # Make this variable go away, we don't need it. unset additional_options # Can't call functions from GDB. set_board_info gdb,cannot_call_functions 1 # Or do I/O. set_board_info gdb,noinferiorio 1 # Or have signals. set_board_info gdb,nosignals 1 # Exit statuses are invalid. set_board_info exit_statuses_bad 1 dejagnu-1.6.3/baseboards/arm-sid.exp0000644000000000000000000000227513471372031014213 00000000000000# Copyright (C) 1997-2016 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. # This is a list of toolchains that are supported on this board. set_board_info target_install {arm-elf thumb-elf} set_board_info sim "arm-elf-sid" # SID does not emulate the FPU process_multilib_options "-msoft-float" set_board_info sim,defaultendian "-EL" # Load the generic configuration for this board. This will define a basic set # of routines needed by the tool to communicate with the board. load_generic_config "sid" dejagnu-1.6.3/baseboards/arm-sim.exp0000644000000000000000000000463713676762721014250 00000000000000# Copyright (C) 1997-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. # Load the generic configuration for this board. This will define a basic # set of routines used to communicate with the board. load_generic_config "sim" # No multilib flags needed by default. process_multilib_options "" if { [board_info $board obj_format] eq "pe" } { set additional_options "-Wl,-oformat,pe-arm-little,--image-base,0" # set_board_info uses_underscores 1 } else { # if [istarget "*-*-coff"] { # set_board_info uses_underscores 1 # } set additional_options "" } # basic-sim.exp is a basic description for the standard Cygnus simulator. load_base_board_description "basic-sim" # The name of the directory in the build tree where the simulator lives. setup_sim arm # The compiler used to build for this board. This has *nothing* to do # with what compiler is tested if we're testing gcc. set_board_info compiler "[find_gcc]" # The basic set of flags needed to build "hello world" for this # board. This board uses libgloss and newlib. set_board_info cflags "[libgloss_include_flags] [newlib_include_flags]" set_board_info ldflags "[libgloss_link_flags] [newlib_link_flags] $additional_options" # This board doesn't use a linker script. set_board_info ldscript "" # The simulator doesn't return exit statuses and we need to indicate this. set_board_info needs_status_wrapper 1 # Used by a few gcc.c-torture testcases to delimit how large the stack can # be. set_board_info gcc,stack_size 16384 # No support for signals. set_board_info gdb,nosignals 1 # More time is needed to compile PlumHall tests set_board_info gcc,timeout 800 # Make this variable go away, we don't need it. unset additional_options dejagnu-1.6.3/baseboards/basic-sid.exp0000644000000000000000000000454713676762721014541 00000000000000# Copyright (C) 1997-2016 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. # find_sid -- find a usable SID simulator. # This proc is local to this file and is used to locate a SID to use. # Search the build tree, then $PATH. # # Written by Ben Elliston (bje@redhat.com). proc find_sid { target_alias } { global env global tool_root_dir set try [lookfor_file $tool_root_dir sid/bsp/$target_alias-sid] if { $try ne "" } { set sid_build [lookfor_file $tool_root_dir sid/main/dynamic/sid] if { $sid_build ne "" } { set env(SID) $sid_build } return $try } # In this case, the bsp script must be available on the PATH. # Just hope for the best! return $target_alias-sid } # find_sid_conf -- find a usable pre-generated SID config file. proc find_sid_conf { config } { global env global srcdir set try [lookfor_file $srcdir sid/bsp/pregen/$config.conf] if { $try eq "" } then { return $config.conf } else { return $try } } # find_rawsid -- find a usable SID simulator. # This proc is local to this file and is used to locate a SID to use. # Search the build tree, then $PATH. proc find_rawsid { } { global env global tool_root_dir global srcdir set try [lookfor_file $tool_root_dir sid/main/dynamic/sid] if { $try eq "" } { set try "sid" } else { # testing build tree set env(SID_LIBRARY_PATH) [join [glob $tool_root_dir/sid/component/* $srcdir/sid/component/*] ":"] # srcdir=/..../sid/component/testsuite set tcl_library $srcdir/tcl/library global host_os switch -glob -- $host_os { {cygwin*} { set tcl_library [exec cygpath -w $tcl_library] } } set env(TCL_LIBRARY) $tcl_library } return $try } dejagnu-1.6.3/baseboards/basic-sim.exp0000644000000000000000000000415613407073624014533 00000000000000# Copyright (C) 1997-2016 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. # find_sim -- find a usable simulator # This proc is local to this file and is used to locate a simulator to use. # First we see if SIM=foo was specified on the command line. # Otherwise we search the build tree, then $PATH. proc find_sim { target_alias sim_dir sim_name } { global tool_root_dir global SIM if {[info exists SIM]} { return $SIM } if {[isremote host]} { if {![board_info host exists no_transform_name]} { return $target_alias-$sim_name } else { return $sim_name } } # We have to search because tool_root_dir may actually point to that blasted # "target" subdirectory. set try [lookfor_file $tool_root_dir sim/$sim_dir/$sim_name] if { $try ne "" } { return $try } return $target_alias-$sim_name } proc setup_sim { subdir_name } { global target_alias global tool_root_dir global board if {[info exists target_alias]} { set tmp $target_alias } else { if {[board_info $board exists target_install]} { set tmp [lindex [board_info $board target_install] 0] } } if {![board_info $board exists sim]} { set_board_info sim [find_sim $tmp $subdir_name run] } verbose "Using simulator [board_info $board sim]\n" } set_board_info is_simulator 1 # Most simulators need the image reloaded and reinitialized to rerun. set_board_info gdb,do_reload_on_run 1 dejagnu-1.6.3/baseboards/cris-sim.exp0000644000000000000000000000540313676762721014421 00000000000000# Copyright (C) 1997-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. # This is a list of toolchains that are supported on this board. set_board_info target_install {cris-elf crisv32-elf cris-aout cris-linux-gnu crisv32-linux-gnu} # Load the generic configuration for this board. This will define a basic set # of routines needed by the tool to communicate with the board. load_generic_config "sim" # basic-sim.exp is a basic description for the standard Cygnus simulator. load_base_board_description "basic-sim" # The name of the sim subdir in src/sim. setup_sim cris # This simulator isn't slow. set_board_info slow_simulator 0 # No multilib options needed by default. process_multilib_options "" set cris_ldopt "-sim3" set cris_simopt "" if {[istarget *-*-linux*]} { set cris_ldopt "-static" } # Support different multilibs and targets. foreach x $board_variant_list { regsub -all "^\[ \t\]*" $x "" x regsub -all "\[ \t\]*$" $x "" x switch -- $x { # We force the arch to either pre-v32 (i.e. v10) or v32 for the # "common" compatible subset, by letting the otherwise # functionally equivalent gcc options "-march=..." and # "-mcpu=..." control that. (We don't have to force the # architecture, but it's easier to make sure we can check that # the "common" subset doesn't lose the compatibility.) # Mnemonic: "a" is 10. "arch=common_v10_v32" - "-march=common_v10_v32" { set cris_simopt "--architecture cris" } # Mnemonic: "c" is... eh... comes after 10! "cpu=common_v10_v32" - "-mcpu=common_v10_v32" { set cris_simopt "--architecture crisv32" } } } if { ![board_info $board exists sim,options] && $cris_simopt ne "" } { set_board_info sim,options $cris_simopt } # Other than an already-installed glibc, we only support newlib on this # target. We assume that all multilib options have been specified # before we get here. set_board_info cflags "[libgloss_include_flags] [newlib_include_flags]" set_board_info ldflags "[libgloss_link_flags] [newlib_link_flags] $cris_ldopt" # No linker script needed. set_board_info ldscript "" dejagnu-1.6.3/baseboards/d30v-sim.exp0000644000000000000000000000363713676762721014244 00000000000000# Copyright (C) 1997-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. # This is a list of toolchains that are supported on this board. set_board_info target_install {d30v-elf} # Load the generic configuration for this board. This will define any # routines needed to communicate with the board. load_generic_config "sim" # basic-sim.exp is a basic description for the standard Cygnus simulator. load_base_board_description "basic-sim" # The name of the simulator directory is "d30v". setup_sim d30v # We only support newlib on this target. We assume that all multilib # options have been specified before we get here. # Pass -C to the assembler to suppress the warning about symbols being the same name as registers set_board_info cflags "[libgloss_include_flags] [newlib_include_flags] -Wa,-C" set_board_info ldflags "[libgloss_link_flags] [newlib_link_flags] -mextmem -Wl,--defsym,__stack=0x80800000" # No linker script needed. set_board_info ldscript "" # Can't pass arguments to programs on this target.. set_board_info noargs 1 # And there's no support for signals. set_board_info gdb,nosignals 1 # Used by a few gcc.c-torture testcases to delimit how large the stack can # be. set_board_info gcc,stack_size 5000 dejagnu-1.6.3/baseboards/fr30-sim.exp0000644000000000000000000000372413676762721014237 00000000000000# Copyright (C) 1997-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. # This is a list of toolchains that are supported on this board. set_board_info target_install {fr30-elf} # Load the generic configuration for this board. This will define a basic set # of routines needed by the tool to communicate with the board. load_generic_config "sim" # basic-sim.exp is a basic description for the standard Cygnus simulator. load_base_board_description "basic-sim" # "fr30" is the name of the sim subdir. setup_sim fr30 # No multilib options needed by default. process_multilib_options "" # We only support newlib on this target. We assume that all multilib # options have been specified before we get here. set_board_info cflags "[libgloss_include_flags] [newlib_include_flags]" set_board_info ldflags "[libgloss_link_flags] [newlib_link_flags]" # No linker script needed. set_board_info ldscript "" # The simulator doesn't return exit statuses and we need to indicate this; # the standard GCC wrapper will work with this target. set_board_info needs_status_wrapper 1 # Doesn't pass arguments or signals, can't return results, and doesn't # do inferiorio. set_board_info noargs 1 set_board_info gdb,nosignals 1 set_board_info gdb,noresults 1 set_board_info gdb,noinferiorio 1 dejagnu-1.6.3/baseboards/frv-sim.exp0000644000000000000000000000372613676762721014264 00000000000000# Copyright (C) 1997-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. # This is a list of toolchains that are supported on this board. set_board_info target_install {frv-elf} # Load the generic configuration for this board. This will define a basic set # of routines needed by the tool to communicate with the board. load_generic_config "sim" # basic-sim.exp is a basic description for the standard Cygnus simulator. load_base_board_description "basic-sim" # "frv" is the name of the sim subdirectory. setup_sim frv # No multilib options needed by default. process_multilib_options "" # We only support newlib on this target. We assume that all multilib # options have been specified before we get here. set_board_info cflags "[libgloss_include_flags] [newlib_include_flags]" set_board_info ldflags "[libgloss_link_flags] [newlib_link_flags]" # No linker script needed. set_board_info ldscript "" # Doesn't pass arguments or signals, can't return results, and doesn't # do inferiorio. set_board_info noargs 1 set_board_info gdb,nosignals 1 set_board_info gdb,noresults 1 # More time is needed set_board_info gcc,timeout 800 set_board_info gdb,timeout 60 # Used by a few gcc.c-torture testcases to delimit how large the stack can # be. set_board_info gcc,stack_size 5000 dejagnu-1.6.3/baseboards/gdbserver-sample.exp0000644000000000000000000000406513676762721016140 00000000000000# Copyright (C) 1997-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. # gdbserver running over ssh. load_generic_config "gdbserver" process_multilib_options "" # The default compiler for this target. #set_board_info compiler "/opt/src/gcc/install-30/bin/gcc" #set_board_info c++compiler "/opt/src/gcc/install-30/bin/g++" set_board_info rsh_prog /usr/bin/ssh set_board_info rcp_prog /usr/bin/scp set_board_info protocol standard set_board_info hostname voltaire.debian.org set_board_info username dan set_board_info gdb_server_prog /home/dan/gdb/mv/obj/gdb/gdbserver/gdbserver # We will be using the standard GDB remote protocol set_board_info gdb_protocol "remote" # Path to the gdbserver executable, if required. set_board_info gdb_server_prog "../gdbserver/gdbserver" # Name of the computer whose socket will be used, if required. set_board_info sockethost "voltaire:" # Port ID to use for socket connection # set_board_info gdb,socketport "4004" # Use techniques appropriate to a stub set_board_info use_gdb_stub 1 # This gdbserver can only run a process once per session. set_board_info gdb,do_reload_on_run 1 # There's no support for argument-passing (yet). set_board_info noargs 1 # Can't do input (or output) in the current gdbserver. set_board_info gdb,noinferiorio 1 # Can't do hardware watchpoints, in general set_board_info gdb,no_hardware_watchpoints 1 dejagnu-1.6.3/baseboards/generic-sim.exp0000644000000000000000000000546113471374461015072 00000000000000# Copyright (C) 2012-2016 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. # Contributed by Steve Ellcey . # Use env to check env. variables and modify the simulator. global env global SIM # Load the generic configuration for this board. This will define a basic # set of routines needed by the tool to communicate with the board. load_generic_config "sim" # basic-sim.exp is a basic description for the standard Cygnus simulator. load_base_board_description "basic-sim" # The TCL SIM variable takes precedence over the DEJAGNU_SIM env. variable if {[info exists env(DEJAGNU_SIM)] && ![info exists SIM]} { set SIM $env(DEJAGNU_SIM) } # This tells it which directory to look in for the simulator. setup_sim sim # No multilib flags are set by default. if {[info exists env(DEJAGNU_SIM_MULTILIB_OPTIONS)]} { process_multilib_options $env(DEJAGNU_SIM_MULTILIB_OPTIONS) } else { process_multilib_options "" } # The compiler used to build for this board. This has *nothing* to do # with what compiler is tested if we're testing gcc. if {[info exists env(DEJAGNU_SIM_GCC)]} { set_board_info compiler $env(DEJAGNU_SIM_GCC) } else { set_board_info compiler "[find_gcc]" } if {[info exists env(DEJAGNU_SIM_INCLUDE_FLAGS)]} { set_board_info cflags "[libgloss_include_flags] [newlib_include_flags] $env(DEJAGNU_SIM_INCLUDE_FLAGS)" } else { set_board_info cflags "[libgloss_include_flags] [newlib_include_flags]" } if {[info exists env(DEJAGNU_SIM_LINK_FLAGS)]} { set_board_info ldflags "[libgloss_link_flags] [newlib_link_flags] $env(DEJAGNU_SIM_LINK_FLAGS)" } else { set_board_info ldflags "[libgloss_link_flags] [newlib_link_flags]" } if {[info exists env(DEJAGNU_SIM_LDSCRIPT)]} { set_board_info ldscript $env(DEJAGNU_SIM_LDSCRIPT) } if {[info exists env(DEJAGNU_SIM_SPECFILE)]} { set_board_info specfile "-specs=$env(DEJAGNU_SIM_SPECFILE)" } if {[info exists env(DEJAGNU_SIM_OPTIONS)]} { set_board_info sim,options $env(DEJAGNU_SIM_OPTIONS) } if {[info exists env(DEJAGNU_SIM_BOARD_INFO)]} { foreach e $env(DEJAGNU_SIM_BOARD_INFO) { set_board_info [lindex $e 0] [lindex $e 1] } } dejagnu-1.6.3/baseboards/i386-sid.exp0000644000000000000000000000316713407073624014133 00000000000000# Copyright (C) 1997-2016 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. # This is a list of toolchains that are supported on this board. set_board_info target_install {i386-elf} # Load a baseboard description for SID simulators. load_base_board_description "basic-sid" set_board_info sim [find_rawsid] set_board_info sim,protocol "sid" set_board_info ldflags "-nostdlib [libgloss_link_flags] [newlib_link_flags]" set_board_info ldscript "-Tcygmon.ld" set_board_info gdb,start_symbol "__start" if { $tool eq "gdb" } { set_board_info sim,options "-f [find_sid_conf i386-gdb]" } else { set_board_info sim,options "-f [find_sid_conf i386-gloss]" } # Used by a few gcc.c-torture testcases to delimit how large the # stack can be. set_board_info gcc,stack_size 16384 # Load the generic configuration for this board. This will define a basic set # of routines needed by the tool to communicate with the board. load_generic_config "sid" dejagnu-1.6.3/baseboards/iq2000-sim.exp0000644000000000000000000000372613676762721014402 00000000000000# Copyright (C) 1997-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. # This is a list of toolchains that are supported on this board. set_board_info target_install {iq2000-elf} # Load the generic configuration for this board. This will define a basic set # of routines needed by the tool to communicate with the board. load_generic_config "sim" # basic-sim.exp is a basic description for the standard Cygnus simulator. load_base_board_description "basic-sim" setup_sim iq2000 # No multilib options needed by default. process_multilib_options "" # We only support newlib on this target. We assume that all multilib # options have been specified before we get here. set_board_info cflags "[libgloss_include_flags] [newlib_include_flags]" set_board_info ldflags "[libgloss_link_flags] [newlib_link_flags]" # Special linker script needed to run C programs. set_board_info ldscript "-Tsim.ld" # The simulator doesn't return exit statuses and we need to indicate this # the standard GCC wrapper will work with this target. set_board_info needs_status_wrapper 1 # Doesn't pass arguments or handle signals, # Can return results. # Does do inferiorio. set_board_info noargs 1 set_board_info gcc,no_trampolines 1 set_board_info gcc,no_label_values 1 set_board_info gdb,nosignals 1 dejagnu-1.6.3/baseboards/jmr3904-sim.exp0000644000000000000000000000231513407073624014555 00000000000000# Copyright (C) 1997-2016 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. # And we use the jmr3904 linker script. set_board_info ldscript "-Tjmr3904app.ld" # Pass --board=jmr3904 to the standalone simulator set_board_info sim,options "--board=jmr3904" set_board_info gdb,target_sim_options "--board=jmr3904" # Pass -G 0 when testing libjava set_board_info libjava,options "-G 0" set_board_info gcc,stack_size "8192" # Otherwise we're the same as the standard MIPS simulator. load_base_board_description "mips-sim" dejagnu-1.6.3/baseboards/linux-gdbserver.exp0000644000000000000000000000322613676762721016014 00000000000000# Copyright (C) 1997-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. # gdbserver running native. load_generic_config "gdbserver" process_multilib_options "" # We will be using the standard GDB remote protocol set_board_info gdb_protocol "remote" # Path to the gdbserver executable, if required. set_board_info gdb_server_prog \ "../gdbserver/gdbserver" # Name of the computer whose socket will be used, if required. set_board_info sockethost "localhost:" # Port ID to use for socket connection # set_board_info gdb,socketport "4004" # Use techniques appropriate to a stub set_board_info use_gdb_stub 1 # This gdbserver can only run a process once per session. set_board_info gdb,do_reload_on_run 1 # There's no support for argument-passing (yet). set_board_info noargs 1 # Can't do input (or output) in the current gdbserver. set_board_info gdb,noinferiorio 1 # Can't do hardware watchpoints, in general set_board_info gdb,no_hardware_watchpoints 1 dejagnu-1.6.3/baseboards/linux-libremote.exp0000644000000000000000000000325013676762721016010 00000000000000# Copyright (C) 1997-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. # Libremote gdbserver running native. load_generic_config "gdbserver" process_multilib_options "" # We will be using the standard GDB remote protocol set_board_info gdb_protocol "remote" # Path to the gdbserver executable, if required. set_board_info gdb_server_prog \ "../../libremote/native/server" # Name of the computer whose socket will be used, if required. # set_board_info sockethost "localhost" # Port ID to use for socket connection # set_board_info gdb,socketport "4004" # Use techniques appropriate to a stub set_board_info use_gdb_stub 1 # This gdbserver can only run a process once per session. set_board_info gdb,do_reload_on_run 1 # There's no support for argument-passing (yet). set_board_info noargs 1 # Can't do input (or output) in the current gdbserver. set_board_info gdb,noinferiorio 1 # Can't do hardware watchpoints, in general set_board_info gdb,no_hardware_watchpoints 1 dejagnu-1.6.3/baseboards/m68k-sid.exp0000644000000000000000000000210613407073624014217 00000000000000# Copyright (C) 1997-2016 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. # This is a list of toolchains that are supported on this board. set_board_info target_install {m68k-elf} set_board_info sim "m68k-elf-sid" # Load the generic configuration for this board. This will define a basic set # of routines needed by the tool to communicate with the board. load_generic_config "sid" dejagnu-1.6.3/baseboards/mcore-moto-sim.exp0000644000000000000000000001043113676762721015537 00000000000000# Copyright (C) 1997-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. # This is a HACKED version of mcore-sim.exp that is intended to # support running tests on Motorola's proprietary MCore simulator. # It is quite likely that this file will need to be modified in # order for you to use Motorola's simulator. # This is a list of toolchains that are supported on this board. set_board_info target_install {mcore-elf, mcore-pe} # Do general config stuff but do not load anything. "jim" was # chosen because it does not exist. load_generic_config "jim" process_multilib_options "" # We only support newlib on this target. We assume that all multilib # options have been specified before we get here. set_board_info cflags "[libgloss_include_flags] [newlib_include_flags]" set_board_info ldflags "[libgloss_link_flags] [newlib_link_flags]" # No linker script needed. set_board_info ldscript "" # The simulator doesn't return exit statuses and we need to indicate this; # the standard GCC wrapper will work with this target. set_board_info needs_status_wrapper 1 # Doesn't pass arguments or signals, can't return results, and doesn't # do inferiorio. set_board_info noargs 1 set_board_info gdb,nosignals 1 set_board_info gdb,noresults 1 set_board_info gdb,noinferiorio 1 # Rather than include the normal simulator support files, # their functions are reproduced (and modified) here. # -------------------------------------------------------------- proc sim_spawn { dest cmdline args } { # Choose whoch simulator to run ## XXX - fixme - this should be automatic based on the ## multilib option. ## XXX - fixme - this should not be hardcoded. set sim "/home/nickc/bin/linux/sim-be" # set sim "/home/nickc/bin/linux/sim-le" set simflags "-m abi" # Create a script to run the program set handle [open doit w] puts $handle "load $cmdline" puts $handle "reset" puts $handle "g 28" puts $handle "quit" close $handle return [eval remote_spawn host \{ $sim $simflags "-sdoit" \} $args] } proc sim_wait { dest timeout } { return [remote_wait host $timeout] } proc sim_load { dest prog args } { if {![file exists $prog]} then { perror "sim.exp: $prog to be downloaded does not exist." verbose -log "$prog to be downloaded does not exist." 3 return [list "untested" ""] } set sim_time_limit 240 set output "" set res [remote_spawn target $prog] if { $res <= 0 } { return [list "fail" "remote_spawn failed"] } set state [remote_wait target $sim_time_limit] set status [lindex $state 0] set output [lindex $state 1] verbose "Output is $output" set status2 [check_for_board_status output] if { $status2 >= 0 } { set status $status2 } verbose "Return status was: $status" 2 if { $status == 0 } { set result "pass" } else { set result "fail" } return [list $result $output] } set_board_info protocol "sim" # By default, assume the simulator is slow. This causes some tests # to either be simplified or skipped completely. set_board_info slow_simulator 1 # ----------------------------------------------------------- # find_sim -- find a usable simulator # This proc is local to this file and is used to locate a simulator to use. # First we see if SIM=foo was specified on the command line. # Otherwise we search the build tree, then $PATH. proc find_sim { target_alias sim_dir sim_name } { ## XXX - fixme - this should not be hardcoded. ## XXX - fixme - this should vary depending upon endianism selected. return "/home/nickc/bin/linux/sim-be" } set_board_info is_simulator 1 dejagnu-1.6.3/baseboards/mcore-sim.exp0000644000000000000000000000402713676762721014567 00000000000000# Copyright (C) 1997-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. # This is a list of toolchains that are supported on this board. set_board_info target_install {mcore-elf, mcore-pe} # Load the generic configuration for this board. This will define a basic set # of routines needed by the tool to communicate with the board. load_generic_config "sim" # basic-sim.exp is a basic description for the standard Cygnus simulator. load_base_board_description "basic-sim" # "mcore" is the name of the sim subdir. setup_sim mcore # No multilib options needed by default. process_multilib_options "" # We only support newlib on this target. We assume that all multilib # options have been specified before we get here. set_board_info cflags "[libgloss_include_flags] [newlib_include_flags]" set_board_info ldflags "[libgloss_link_flags] [newlib_link_flags]" # No linker script needed. set_board_info ldscript "" # The simulator doesn't return exit statuses and we need to indicate this; # the standard GCC wrapper will work with this target. set_board_info needs_status_wrapper 1 # Doesn't pass arguments or signals, can't return results, and doesn't # do inferiorio. set_board_info noargs 1 set_board_info gdb,nosignals 1 set_board_info gdb,noresults 1 set_board_info gdb,noinferiorio 1 set_board_info gdb,skip_float_tests 1 set timeout 45 dejagnu-1.6.3/baseboards/mips-lnews-sim.exp0000644000000000000000000000166013407073624015545 00000000000000# Copyright (C) 1997-2016 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. # lnews linker script. set_board_info ldscript "-Tlnews.ld" # Otherwise, it's the same as the standard mips simulator. load_base_board_description "mips-sim" dejagnu-1.6.3/baseboards/mips-lsi-sim.exp0000644000000000000000000000175413407073624015210 00000000000000# Copyright (C) 1997-2016 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. # We need mips16. add_multilib_option "-mips16" # And we use the lsi linker script. set_board_info ldscript "-Tlsi.ld" # Otherwise we're the same as the standard MIPS simulator. load_base_board_description "mips-sim" dejagnu-1.6.3/baseboards/mips-sim-idt32.exp0000644000000000000000000000347213676762721015360 00000000000000# Copyright (C) 1997-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. # Load the generic configuration for this board. This will define a basic # set of routines needed by the tool to communicate with the board. load_generic_config "sim" # basic-sim.exp is a basic description for the standard Cygnus simulator. load_base_board_description "basic-sim" # This tells it which directory to look in for the simulator. setup_sim mips # No multilib flags are set by default. process_multilib_options "" #set_board_info needs_status_wrapper 1 set_board_info cflags "[libgloss_include_flags] [newlib_include_flags]" set_board_info ldflags "[libgloss_link_flags] [newlib_link_flags]" # Use idt. if { [board_info $board obj_format] eq "ecoff" } { set_board_info ldscript "-Tidtecoff.ld" } else { set_board_info ldscript "-Tidt32.ld" } # And, it can't do arguments, and doesn't have real signals. set_board_info noargs 1 set_board_info gdb,nosignals 1 # Tell gdb to assume no fpu for -msoft-float compilation if {[string match "*soft-float*" $current_target_name]} { set_board_info gdb_init_command "set mipsfpu none" } dejagnu-1.6.3/baseboards/mips-sim-idt64.exp0000644000000000000000000000347213676762721015365 00000000000000# Copyright (C) 1997-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. # Load the generic configuration for this board. This will define a basic # set of routines needed by the tool to communicate with the board. load_generic_config "sim" # basic-sim.exp is a basic description for the standard Cygnus simulator. load_base_board_description "basic-sim" # This tells it which directory to look in for the simulator. setup_sim mips # No multilib flags are set by default. process_multilib_options "" #set_board_info needs_status_wrapper 1 set_board_info cflags "[libgloss_include_flags] [newlib_include_flags]" set_board_info ldflags "[libgloss_link_flags] [newlib_link_flags]" # Use idt. if { [board_info $board obj_format] eq "ecoff" } { set_board_info ldscript "-Tidtecoff.ld" } else { set_board_info ldscript "-Tidt64.ld" } # And, it can't do arguments, and doesn't have real signals. set_board_info noargs 1 set_board_info gdb,nosignals 1 # Tell gdb to assume no fpu for -msoft-float compilation if {[string match "*soft-float*" $current_target_name]} { set_board_info gdb_init_command "set mipsfpu none" } dejagnu-1.6.3/baseboards/mips-sim-mti32.exp0000644000000000000000000000347013676762721015367 00000000000000# Copyright (C) 2012-2016, 2019 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. # Load the generic configuration for this board. This will define a basic # set of routines needed by the tool to communicate with the board. load_generic_config "sim" # basic-sim.exp is a basic description for the standard Cygnus simulator. load_base_board_description "basic-sim" # This tells it which directory to look in for the simulator. setup_sim mips # No multilib flags are set by default. process_multilib_options "" #set_board_info needs_status_wrapper 1 set_board_info cflags "[libgloss_include_flags] [newlib_include_flags]" set_board_info ldflags "[libgloss_link_flags] [newlib_link_flags]" # Use the mti32.ld linker script from libgloss for the o32 ABI and the # mips32 architecture on the gnu/gdb simulator. set_board_info ldscript "-Tmti32.ld" # And, it can't do arguments, and doesn't have real signals. set_board_info noargs 1 set_board_info gdb,nosignals 1 # Tell gdb to assume no fpu for -msoft-float compilation if {[string match "*soft-float*" $current_target_name]} { set_board_info gdb_init_command "set mipsfpu none" } dejagnu-1.6.3/baseboards/mips-sim-mti64.exp0000644000000000000000000000347013676762721015374 00000000000000# Copyright (C) 2012-2016, 2019 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. # Load the generic configuration for this board. This will define a basic # set of routines needed by the tool to communicate with the board. load_generic_config "sim" # basic-sim.exp is a basic description for the standard Cygnus simulator. load_base_board_description "basic-sim" # This tells it which directory to look in for the simulator. setup_sim mips # No multilib flags are set by default. process_multilib_options "" #set_board_info needs_status_wrapper 1 set_board_info cflags "[libgloss_include_flags] [newlib_include_flags]" set_board_info ldflags "[libgloss_link_flags] [newlib_link_flags]" # Use the mti64.ld linker script from libgloss for the o32 ABI and the # mips64 architecture on the gnu/gdb simulator. set_board_info ldscript "-Tmti64.ld" # And, it can't do arguments, and doesn't have real signals. set_board_info noargs 1 set_board_info gdb,nosignals 1 # Tell gdb to assume no fpu for -msoft-float compilation if {[string match "*soft-float*" $current_target_name]} { set_board_info gdb_init_command "set mipsfpu none" } dejagnu-1.6.3/baseboards/mips-sim-mti64_64.exp0000644000000000000000000000347613676762721015713 00000000000000# Copyright (C) 2012-2016, 2019 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. # Load the generic configuration for this board. This will define a basic # set of routines needed by the tool to communicate with the board. load_generic_config "sim" # basic-sim.exp is a basic description for the standard Cygnus simulator. load_base_board_description "basic-sim" # This tells it which directory to look in for the simulator. setup_sim mips # No multilib flags are set by default. process_multilib_options "" #set_board_info needs_status_wrapper 1 set_board_info cflags "[libgloss_include_flags] [newlib_include_flags]" set_board_info ldflags "[libgloss_link_flags] [newlib_link_flags]" # Use the mti64_64.ld linker script from libgloss for the n64 ABI and the # mips64 architecture on the gnu/gdb simulator. set_board_info ldscript "-Tmti64_64.ld" # And, it can't do arguments, and doesn't have real signals. set_board_info noargs 1 set_board_info gdb,nosignals 1 # Tell gdb to assume no fpu for -msoft-float compilation if {[string match "*soft-float*" $current_target_name]} { set_board_info gdb_init_command "set mipsfpu none" } dejagnu-1.6.3/baseboards/mips-sim-mti64_n32.exp0000644000000000000000000000350013676762721016050 00000000000000# Copyright (C) 2012-2016, 2019 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. # Load the generic configuration for this board. This will define a basic # set of routines needed by the tool to communicate with the board. load_generic_config "sim" # basic-sim.exp is a basic description for the standard Cygnus simulator. load_base_board_description "basic-sim" # This tells it which directory to look in for the simulator. setup_sim mips # No multilib flags are set by default. process_multilib_options "" #set_board_info needs_status_wrapper 1 set_board_info cflags "[libgloss_include_flags] [newlib_include_flags]" set_board_info ldflags "[libgloss_link_flags] [newlib_link_flags]" # Use the mti64_n32.ld linker script from libgloss for the n32 ABI and the # mips64 architecture on the gnu/gdb simulator. set_board_info ldscript "-Tmti64_n32.ld" # And, it can't do arguments, and doesn't have real signals. set_board_info noargs 1 set_board_info gdb,nosignals 1 # Tell gdb to assume no fpu for -msoft-float compilation if {[string match "*soft-float*" $current_target_name]} { set_board_info gdb_init_command "set mipsfpu none" } dejagnu-1.6.3/baseboards/mips-sim-sde32.exp0000644000000000000000000000347013676762721015351 00000000000000# Copyright (C) 2012-2016, 2019 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. # Load the generic configuration for this board. This will define a basic # set of routines needed by the tool to communicate with the board. load_generic_config "sim" # basic-sim.exp is a basic description for the standard Cygnus simulator. load_base_board_description "basic-sim" # This tells it which directory to look in for the simulator. setup_sim mips # No multilib flags are set by default. process_multilib_options "" #set_board_info needs_status_wrapper 1 set_board_info cflags "[libgloss_include_flags] [newlib_include_flags]" set_board_info ldflags "[libgloss_link_flags] [newlib_link_flags]" # Use the sde32.ld linker script from libgloss for the o32 ABI and the # mips32 architecture on the gnu/gdb simulator. set_board_info ldscript "-Tsde32.ld" # And, it can't do arguments, and doesn't have real signals. set_board_info noargs 1 set_board_info gdb,nosignals 1 # Tell gdb to assume no fpu for -msoft-float compilation if {[string match "*soft-float*" $current_target_name]} { set_board_info gdb_init_command "set mipsfpu none" } dejagnu-1.6.3/baseboards/mips-sim-sde64.exp0000644000000000000000000000347013676762721015356 00000000000000# Copyright (C) 2012-2016, 2019 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. # Load the generic configuration for this board. This will define a basic # set of routines needed by the tool to communicate with the board. load_generic_config "sim" # basic-sim.exp is a basic description for the standard Cygnus simulator. load_base_board_description "basic-sim" # This tells it which directory to look in for the simulator. setup_sim mips # No multilib flags are set by default. process_multilib_options "" #set_board_info needs_status_wrapper 1 set_board_info cflags "[libgloss_include_flags] [newlib_include_flags]" set_board_info ldflags "[libgloss_link_flags] [newlib_link_flags]" # Use the sde64.ld linker script from libgloss for the o32 ABI and the # mips64 architecture on the gnu/gdb simulator. set_board_info ldscript "-Tsde64.ld" # And, it can't do arguments, and doesn't have real signals. set_board_info noargs 1 set_board_info gdb,nosignals 1 # Tell gdb to assume no fpu for -msoft-float compilation if {[string match "*soft-float*" $current_target_name]} { set_board_info gdb_init_command "set mipsfpu none" } dejagnu-1.6.3/baseboards/mips-sim.exp0000644000000000000000000000314313676762721014430 00000000000000# Copyright (C) 1997-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. # Load the generic configuration for this board. This will define a basic # set of routines needed by the tool to communicate with the board. load_generic_config "sim" # basic-sim.exp is a basic description for the standard Cygnus simulator. load_base_board_description "basic-sim" # This tells it which directory to look in for the simulator. setup_sim mips # No multilib flags are set by default. process_multilib_options "" set_board_info cflags "[libgloss_include_flags] [newlib_include_flags]" set_board_info ldflags "[libgloss_link_flags] [newlib_link_flags]" # Use idt. if { [board_info $board obj_format] eq "ecoff" } { set_board_info ldscript "-Tidtecoff.ld" } else { set_board_info ldscript "-Tidt.ld" } # And, it can't do arguments, and doesn't have real signals. set_board_info noargs 1 set_board_info gdb,nosignals 1 dejagnu-1.6.3/baseboards/mmixware-sim.exp0000644000000000000000000000532713676762721015317 00000000000000# Copyright (C) 1997-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. # This is a list of toolchains that are supported on this board. set_board_info target_install {mmix-knuth-mmixware} # Load the generic configuration for this board. This will define any # routines needed to communicate with the board. load_generic_config "sim" # Unset the slow_simulator flag; this simulator isn't slow. (I haven't # found documentation as to what constitutes a "slow" simulator and # there's no reference to that variable in the GCC test-suite, but all # tests I've found work.) unset_board_info slow_simulator # We don't use basic-sim.exp and setup_sim because the simulator, called # "mmix", is external to the build tree. If nobody set the simulator # name, we set it to "mmix", so the rest of the framework works. Let $SIM # override. if {![board_info $board exists sim]} { if {[info exists SIM]} { set_board_info sim $SIM } else { # Has to exist in the users path. set_board_info sim mmix } } # No default multilib options are needed for this board. process_multilib_options "" set_board_info is_simulator 1 # It isn't visible in the target triple, so we set it explicitly. The # *linked* format is currently mmo, but those cases where this matters we # can deal with separately. set_board_info obj_format "elf" # We only support newlib on this target. We assume that all multilib # options have been specified before we get here. set_board_info cflags "[newlib_include_flags]" # We put the stack in the code segment, so trampolines work; the mmix # simulator does not allow code to be executed in the "normal" documented # data and stack segments. Use a somewhat magic number, so stack addresses # are easily recognized when debugging. set_board_info ldflags "[newlib_link_flags] -Wl,--defsym,__Stack_start=0x1680a00000000000" # No linker script needed - the simulator is the main environment for this # target. set_board_info ldscript "" # Return codes aren't supported by the simulator. set_board_info needs_status_wrapper 1 dejagnu-1.6.3/baseboards/mn10200-sim.exp0000644000000000000000000000424313676762721014457 00000000000000# Copyright (C) 1997-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. # This is a list of toolchains that are supported on this board. set_board_info target_install {mn10200-elf} # Load the tool-specific configuration for this board, as well as the # generic configuration. This will define any routines needed by the # tool to communicate with the board. load_generic_config "sim" # basic-sim.exp is a basic description for the standard Cygnus simulator. load_base_board_description "basic-sim" # This is the name of the sim subdir. setup_sim mn10200 # No multilib flags are set by default. process_multilib_options "" # We only support newlib on this target. set_board_info cflags "[newlib_include_flags] [libgloss_include_flags]" set_board_info ldflags "[libgloss_link_flags] [newlib_link_flags]" # Simulator linker script. set_board_info ldscript "-Tsim.ld" # The simulator doesn't return exit statuses and we need to indicate this. set_board_info needs_status_wrapper 1 # We can't pass args to the simulator or get exit status back from the # simulator, nor does the simulator support real signals. set_board_info noargs 1 set_board_info gdb,nosignals 1 set_board_info gdb,noresults 1 set_board_info gdb,noinferiorio 1 # The mn10200 doesn't support long long data types or double data types. set_board_info no_long_long 1 set_board_info no_double 1 # Used by a few gcc.c-torture testcases to delimit how large the stack can # be. set_board_info gcc,stack_size 4096 dejagnu-1.6.3/baseboards/mn10300-sim.exp0000644000000000000000000000403613676762721014460 00000000000000# Copyright (C) 1997-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. # This is a list of toolchains that are supported on this board. set_board_info target_install {mn10300-elf} # Load the tool-specific configuration for this board, as well as the # generic configuration. This will define any routines needed by the # tool to communicate with the board. load_generic_config "sim" # basic-sim.exp is a basic description for the standard Cygnus simulator. load_base_board_description "basic-sim" # This is the name of the sim subdir. setup_sim mn10300 # No multilib flags are set by default. process_multilib_options "" # We only support newlib on this target. set_board_info cflags "[newlib_include_flags] [libgloss_include_flags]" set_board_info ldflags "[libgloss_link_flags] [newlib_link_flags]" # Simulator linker script. set_board_info ldscript "-Tsim.ld" # The simulator doesn't return exit statuses and we need to indicate this. set_board_info needs_status_wrapper "" # We can't pass args to the simulator or get exit status back from the # simulator, nor does the simulator support real signals. set_board_info noargs 1 set_board_info gdb,nosignals 1 set_board_info gdb,noresults 0 set_board_info gdb,noinferiorio 1 # Used by a few gcc.c-torture testcases to delimit how large the stack can # be. set_board_info gcc,stack_size 4096 dejagnu-1.6.3/baseboards/moxie-sim.exp0000644000000000000000000000403013676762721014575 00000000000000# Copyright (C) 2010-2016, 2019 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. # This is a list of toolchains that are supported on this board. set_board_info target_install {moxie-elf} # Load the generic configuration for this board. This will define a basic set # of routines needed by the tool to communicate with the board. load_generic_config "sim" # basic-sim.exp is a basic description for the standard Cygnus simulator. load_base_board_description "basic-sim" setup_sim moxie # No multilib options needed by default. process_multilib_options "" # We only support newlib on this target. We assume that all multilib # options have been specified before we get here. set_board_info cflags "[libgloss_include_flags] [newlib_include_flags]" set_board_info ldflags "[libgloss_link_flags] [newlib_link_flags]" # No linker script needed. set_board_info ldscript "-Tsim.ld" # Configuration settings for testsuites set_board_info noargs 1 set_board_info gdb,nosignals 1 set_board_info gdb,noresults 1 set_board_info gdb,cannot_call_functions 1 set_board_info gdb,skip_float_tests 1 set_board_info gdb,can_reverse 1 set_board_info gdb,use_precord 1 # More time is needed set_board_info gcc,timeout 800 set_board_info gdb,timeout 60 # Used by a few gcc.c-torture testcases to delimit how large the stack can # be. set_board_info gcc,stack_size 5000 dejagnu-1.6.3/baseboards/msp430-sim.exp0000644000000000000000000000373113766553307014507 00000000000000# Copyright (C) 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. # Contributed by Nick Clifton . # This is a list of toolchains that are supported on this board. set_board_info target_install {msp430-elf} # Load the generic configuration for this board. This will define a basic set # of routines needed by the tool to communicate with the board. load_generic_config "sim" # basic-sim.exp is a basic description for the standard Cygnus simulator. load_base_board_description "basic-sim" # "msp430" is the name of the sim subdir. setup_sim msp430 # No multilib options needed by default. process_multilib_options "" # We only support newlib on this target. We assume that all multilib # options have been specified before we get here. set_board_info cflags "[libgloss_include_flags] [newlib_include_flags] -msim" set_board_info ldflags "[libgloss_link_flags] [newlib_link_flags]" # Doesn't pass arguments or signals, and doesn't do inferiorio. set_board_info noargs 1 set_board_info gdb,nosignals 1 set_board_info gdb,noinferiorio 1 set_board_info gdb,no_hardware_watchpoints 1 set_board_info gdb,skip_huge_test 1 # Limit the stack size to something real tiny. set_board_info gcc,stack_size 4096 set_board_info gcc,no_trampolines 1 set_board_info gcc,timeout 30 dejagnu-1.6.3/baseboards/mt-sid.exp0000644000000000000000000000372313407073624014060 00000000000000# Copyright (C) 1997-2016 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. # This is a list of toolchains that are supported on this board. set_board_info target_install {mt-elf} # Load a baseboard description for SID simulators. load_base_board_description "basic-sid" set_board_info ldflags "-msim [libgloss_link_flags] [newlib_link_flags]" verbose "Using simulator [board_info $board sim]\n" set_board_info sim [find_rawsid] if { $tool eq "gdb" } { set_board_info sim,options "-f [find_sid_conf mt-gdb]" } else { set_board_info sim,options "-f [find_sid_conf mt-gloss]" } # Used by a few gcc.c-torture testcases when trampolines are used. set_board_info gcc,no_trampolines 1 # Used by a few gcc.c-torture testcases when labels as values are used. set_board_info gcc,no_label_values 1 # Not needed by SID anymore, but needed to suppress warning in # gdb/testsuite/config/sid.exp. set_board_info sim,defaultendian "-EB" # Load the generic configuration for this board. This will define a basic set # of routines needed by the tool to communicate with the board. load_generic_config "sid" # Tells the test harness to use pre-generated sid configurations. set_board_info sim,protocol "sid" # This is the name of our entry point symbol. set_board_info gdb,start_symbol _start dejagnu-1.6.3/baseboards/multi-sim.exp0000644000000000000000000001373013471374545014611 00000000000000# Copyright (C) 2013-2016 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. # Contributed by Steve Ellcey . # With the generic-sim.exp baseboard I would test GCC with something # like: # export DEJAGNU_SIM_LINK_FLAGS="-Wl,--dynamic-linker=/local/home/sellcey/nightly/install-mips-mti-linux-gnu/sysroot-mips-mti-linux-gnu/usr/lib/ld-2.17.90.so -Wl,-rpath=/local/home/sellcey/nightly/install-mips-mti-linux-gnu/sysroot-mips-mti-linux-gnu/usr/lib:/local/home/sellcey/nightly/install-mips-mti-linux-gnu/mips-mti-linux-gnu/lib" # make check RUNTESTFLAGS="--target_board=generic-sim" # # With multi-sim.exp I can skip the export and just do: # make check RUNTESTFLAGS="--target_board=multi-sim" # # And I can also do this now: # make check RUNTESTFLAGS="--target_board=multi-sim\{-EB,-EL\}\{-mhard-float,-msoft-float\}" # Use env to check env. variables and modify the simulator. global env global SIM # Load the generic configuration for this board. This will define a basic # set of routines needed by the tool to communicate with the board. load_generic_config "sim" # basic-sim.exp is a basic description for the standard Cygnus simulator. load_base_board_description "basic-sim" proc get_library_dirlist { args } { global board set compiler "[board_info $board compiler]" set mflags "[board_info $board multilib_flags]" set result [remote_exec host "$compiler $mflags --print-search-dirs"] set regresult [regexp {(libraries: =)(\S*)} $result dummy1 dummy2 libdirlist] if {$regresult == 0} { perror "Could not find compilers library search path." } return [split $libdirlist :] } proc dynamic_linker_flag { args } { global board set compiler "[board_info $board compiler]" set mflags "[board_info $board multilib_flags]" foreach i [get_library_dirlist] { set dynlinker [glob -nocomplain -directory $i ld-*.so] if { $dynlinker ne "" } break } verbose "dynamic_linker_flag: -Wl,--dynamic-linker=$dynlinker" return "-Wl,--dynamic-linker=$dynlinker" } proc rpath_flags { args } { global board set compiler "[board_info $board compiler]" set mflags "[board_info $board multilib_flags] [libgloss_include_flags] [newlib_include_flags] [libgloss_link_flags] [libgloss_link_flags]" set rpathflags "" set gccpath [get_multilibs] foreach i {libgcc_s.so libstdc++.so libgfortran.so libatomic.so libgomp.so} { set result [remote_exec host "$compiler $mflags --print-file-name=$i"] set output [lindex $result 1] set rpathdir [file dirname $output] # If testing an installed compiler, --print-file-name will find the # libraries, if testing a built but not installed compiler it will not # find libraries like libstdc++.so or libgfortran.so so we add the # extra hack/search so it can work. if {$rpathdir eq "."} { if {$i eq "libstdc++.so"} { if {[file exists $gccpath/libstdc++-v3/src/.libs/libstdc++.so]} { set rpathflags "$rpathflags -Wl,-rpath=$gccpath/libstdc++-v3/src/.libs" } } if {$i eq "libgfortran.so"} { if {[file exists $gccpath/libgfortran/.libs/libgfortran.so]} { set rpathflags "$rpathflags -Wl,-rpath=$gccpath/libgfortran/.libs" } } if {$i eq "libatomic.so"} { if {[file exists $gccpath/libatomic/.libs/libatomic.so]} { set rpathflags "$rpathflags -Wl,-rpath=$gccpath/libatomic/.libs" } } if {$i eq "libgomp.so"} { if {[file exists $gccpath/libgomp/.libs/libgomp.so]} { set rpathflags "$rpathflags -Wl,-rpath=$gccpath/libgomp/.libs" } } } else { set rpathflags "$rpathflags -Wl,-rpath=$rpathdir" } } foreach i [get_library_dirlist] { set rpathflags "$rpathflags -Wl,-rpath=$i" } verbose "rpath_flags: $rpathflags" return $rpathflags } # The TCL SIM variable takes precedence over the DEJAGNU_SIM env. variable if {[info exists env(DEJAGNU_SIM)] && ![info exists SIM]} { set SIM $env(DEJAGNU_SIM) } # This tells it which directory to look in for the simulator. setup_sim sim # No multilib flags are set by default. if {[info exists env(DEJAGNU_SIM_MULTILIB_OPTIONS)]} { process_multilib_options $env(DEJAGNU_SIM_MULTILIB_OPTIONS) } else { process_multilib_options "" } # The compiler used to build for this board. This has *nothing* to do # with what compiler is tested if we're testing gcc. if {[info exists env(DEJAGNU_SIM_GCC)]} { set_board_info compiler $env(DEJAGNU_SIM_GCC) } else { set_board_info compiler "[find_gcc]" } if {[info exists env(DEJAGNU_SIM_INCLUDE_FLAGS)]} { set_board_info cflags "[libgloss_include_flags] [newlib_include_flags] $env(DEJAGNU_SIM_INCLUDE_FLAGS)" } else { set_board_info cflags "[libgloss_include_flags] [newlib_include_flags]" } if {[info exists env(DEJAGNU_SIM_LINK_FLAGS)]} { set_board_info ldflags "[libgloss_link_flags] [newlib_link_flags] [dynamic_linker_flag] [rpath_flags] $env(DEJAGNU_SIM_LINK_FLAGS)" } else { set_board_info ldflags "[libgloss_link_flags] [newlib_link_flags] [dynamic_linker_flag] [rpath_flags]" } if {[info exists env(DEJAGNU_SIM_LDSCRIPT)]} { set_board_info ldscript $env(DEJAGNU_SIM_LDSCRIPT) } if {[info exists env(DEJAGNU_SIM_OPTIONS)]} { set_board_info sim,options $env(DEJAGNU_SIM_OPTIONS) } if {[info exists env(DEJAGNU_SIM_BOARD_INFO)]} { foreach e $env(DEJAGNU_SIM_BOARD_INFO) { set_board_info [lindex $e 0] [lindex $e 1] } } dejagnu-1.6.3/baseboards/pi.exp0000644000000000000000000000367013702455635013300 00000000000000# Copyright (C) 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. set_board_info compiler "[find_gcc]" load_generic_config "gdbserver" process_multilib_options "" # The default compiler for this target. set_board_info compiler "[find_gcc]" set_board_info rsh_prog /usr/bin/ssh set_board_info rcp_prog /usr/bin/scp set_board_info protocol standard set_board_info hostname pi # We will be using the standard GDB remote protocol set_board_info gdb_protocol "remote" # Path to the gdbserver executable, use the one on the board set_board_info gdb_server_prog "/usr/bin/gdbserver" # Name of the computer whose socket will be used, if required. set_board_info gdb,sockethost "pi:" # Port ID to use for socket connection # set_board_info gdb,socketport "4004" # Use techniques appropriate to a stub set_board_info use_gdb_stub 1 # This gdbserver can only run a process once per session. set_board_info gdb,do_reload_on_run 1 # There's no support for argument-passing (yet). set_board_info noargs 1 # Can't do input (or output) in the current gdbserver. set_board_info gdb,noinferiorio 1 # Can't do hardware watchpoints, in general set_board_info gdb,no_hardware_watchpoints 1 # statically link the test case executables set_board_info ldflags "-static" dejagnu-1.6.3/baseboards/powerpc-sim.exp0000644000000000000000000000310613676762721015136 00000000000000# Copyright (C) 1997-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. # This is a list of toolchains that are supported on this board. set_board_info target_install {powerpc-eabi} # Load the generic configuration for this board, This will define a basic # set of routines needed by the tool to communicate with the board. load_generic_config "sim" # basic-sim.exp is a basic description for the standard Cygnus simulator. load_base_board_description "basic-sim" # The name of the simulator is "ppc". setup_sim ppc # No multilib flags needed by default. process_multilib_options "" set_board_info cflags "[libgloss_include_flags] [newlib_include_flags]" set_board_info ldflags "-msim [libgloss_link_flags] [newlib_link_flags]" # No support for signals on this target. set_board_info gdb,nosignals 1 # Can't call functions from GDB. # set_board_info gdb,cannot_call_functions 1 dejagnu-1.6.3/baseboards/powerpcle-sim.exp0000644000000000000000000000310613676762721015457 00000000000000# Copyright (C) 1997-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. # This is a list of toolchains that are supported on this board. set_board_info target_install {powerpcle-eabi} # Load the generic configuration for this board, This will define a basic # set of routines needed by the tool to communicate with the board. load_generic_config "sim" # basic-sim.exp is a basic description for the standard Cygnus simulator. load_base_board_description "basic-sim" # The name of the simulator is "ppc". setup_sim ppc # No multilib flags needed by default. process_multilib_options "" set_board_info cflags "[libgloss_include_flags] [newlib_include_flags]" set_board_info ldflags "-msim [libgloss_link_flags] [newlib_link_flags]" # No support for signals on this target. set_board_info gdb,nosignals 1 # Can't call functions from GDB. set_board_info gdb,cannot_call_functions 1 dejagnu-1.6.3/baseboards/pru-sim.exp0000644000000000000000000000475113766541662014273 00000000000000# Copyright (C) 1997-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. # This is a list of toolchains that are supported on this board. set_board_info target_install {pru-elf} # Load the generic configuration for this board, This will define a basic # set of routines needed by the tool to communicate with the board. load_generic_config "sim" # basic-sim.exp is a basic description for the standard Cygnus simulator. load_base_board_description "basic-sim" # The name of the simulator is "pru". setup_sim pru # No multilib flags needed by default. process_multilib_options "" # The compiler used to build for this board. This has *nothing* to do # with what compiler is tested if we're testing gcc. set_board_info compiler "[find_gcc]" # PRU arguments are mostly passed in registers. But GCC regression tests # are written with other machines in mind, so the builtin_apply's # aruments stack size is non-zero. On top of that, the stack top for # PRU's main is very close to the end of SRAM. Close enough that the # spurious "stack copy" reads outside of the DRAM area, causing a # simulator abort. For example, see how builtin-apply-3.c copies 16 # bytes from the arguments stack, while PRU has passed all of its # arguments in registers. # # Temporary solution is to add a few bytes of "guard" space, so that # existing GCC testcases can be executed successfully. Hence set the # stack top a few bytes below the simulator's DRAM end. set workaround_ldflags "-Wl,--defsym=_stack_top=0x3fff800" set_board_info cflags "-mmcu=sim [libgloss_include_flags] [newlib_include_flags]" set_board_info ldflags "[libgloss_link_flags] [newlib_link_flags] $workaround_ldflags" # No support for signals on this target. set_board_info gdb,nosignals 1 # Low-end workstations might require even larger timeouts. set timeout 120 dejagnu-1.6.3/baseboards/qemu.exp0000644000000000000000000001653313714406441013633 00000000000000# # Copyright (C) 2020 Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or modify # 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. # load_base_board_description "gdbserver-support" set qemu "" set spec "" # No multilib flags needed by default. process_multilib_options "" set_board_info compiler [find_gcc] # When testing GCC in tree, the libgloss linker scripts files aren't # usually in a known location, so we have to find them in the sysroot. # FIXME: this may change in the near future, but for now it works. set compiler "[find_gcc]" set ret [local_exec "$compiler --print-sysroot" "" "" $timeout] if { [lindex $ret 0] == 0 } { set sysroot "[lindex $ret 1]" # Strip the CR or LF off the end of the line as returned by GCC regsub -all "\[\n\r\]+" $sysroot "" sysroot } # set library path environment variable for qemu set env(QEMU_LD_PREFIX) $sysroot # Define ld_library_path variable to workaround asan and go testsuites # referring to it set ld_library_path "" # In the beginning, only linker scripts were used to produce a fully # linked executable. Then a better solution of having GCC spec file # "patches" worked much better. None of the ARM/AARCH64 target # use linker scripts, some targets support both, some just the # linker script. set ldscripts [ glob -nocomplain $sysroot/usr/lib/*.ld ] if { [string length $ldscripts] == 0 } { warning "No linker scripts found." } set specfiles [ glob -nocomplain $sysroot/usr/lib/*.specs ] if { [string length $specfiles] == 0 } { warning "No spec files found." } else { # FIXME: For now, both ldscripts and specfiles are ignored, and a # single value is used tor testing. foreach spec $specfiles { verbose "Found spec file $spec" } } # The basic set of flags needed to build "hello world" for this # board. This board uses libgloss and newlib. case "$target_triplet" in { { "armeb-*-eabi*" } { set qemu "qemu-armeb" set spec "elf-rdimon.specs" } { "arm-pi3-*" } { set qemu "qemu-arm" set spec="-static" set target_list pi } { "arm*-*-eabi*" } { set qemu "qemu-arm" set spec="-static" set spec "elf-rdimon.specs" } { "aarch64be-*-elf" } { set qemu "qemu-aarch64_be" set spec "rdimon.specs" } { "aarch64*-gnu*" } { set qemu "qemu-aarch64" set spec "-static" } { "aarch64*-*elf*" } { # There's multiple spec files, but rdimon is the # one usually used for testing. set qemu "qemu-aarch64" set spec "rdimon.specs" } # FIXME: These following qemu variants are just what QEMU # supports, the pattern to match for the target needs to be # researched. { "cris*" } { set qemu "qemu-cris" } { "microblaze-*" } { set qemu "qemu-microblaze" set spec "elf-gloss-linux.specs" } { "microblazeel-*" } { set qemu "qemu-microblazeel" set spec "elf-gloss-linux.specs" } { "mips" } { set qemu "qemu-mips" } { "mips64-*" } { set qemu "qemu-mips64" } { "mips64el-*" } { set qemu "qemu-mips64el" } { "mipsel-*" } { set qemu "qemu-mipsel" } { "mipsn32-*" } { set qemu "qemu-mipsn32" } { "mipsn32el-*" } { set qemu "qemu-mipsn32el" } { "ppc-*" } { set qemu "qemu-ppc" } { "ppc64-*" } { set qemu "qemu-ppc64" } { "ppc64abi32-*" } { set qemu "qemu-ppc64abi32" } { "ppc64le-*" } { set qemu "qemu-ppc64le" } { "riscv32-elf" } { set qemu "qemu-riscv32" } { "riscv64-elf" } { set qemu "qemu-riscv64" set spec "nano.spec" } { "sh4-*" } { set qemu "qemu-sh4" } { "sh4eb-*" } { set qemu "qemu-sh4eb" } { "sparc=*" } { set qemu "qemu-sparc" } { "sparc32plus-*" } { set qemu "qemu-sparc32plus" } { "sparc64-*" } { set qemu "qemu-sparc64" } default { puts "No target hardware for $target_triplet" } } # 2345 is the default port used for the remote debugging protocol set port "2345" # QEMU uses the standard renmote debugging protocol as used by gdbserver. set_board_info gdb_protocol "remote" # localhost is the default host used for the remote debugging protocol set_board_info sockethost "localhost" set_board_info gdb,socketport $port set_board_info target_sim_options "-g $port" set_board_info gdb_server_prog $qemu set_board_info specfile $spec set_board_info needs_status_wrapper 1 #set_board_info protocol standard push_config target qemu # Path to the gdbserver executable, if required. set_board_info gdb_server_prog "/usr/bin/gdbserver" # This gdbserver can only run a process once per session. set_board_info gdb,do_reload_on_run 1 set_board_info exit_is_reliable 1 # Set this if the board does not support passing arguments to the # inferior process. set_board_info noargs 0 set_board_info cflags "[libgloss_include_flags]" set_board_info ldflags "[libgloss_link_flags] [newlib_link_flags] -specs=$spec -static" set_board_info rsh_prog /usr/bin/ssh set_board_info rcp_prog /usr/bin/scp proc qemu_load { dest prog args } { global qemu global timeout set ret [local_exec "$qemu $prog" "" "" $timeout] if { [array size ret] == 0 } { return "pass" } else { return "fail" } } # # Start QEMU with the executable # proc qemu_download { dest prog args } { global qemu global timeout # qemu is already running with our executable. } # # Load executable into GDB # proc gdb_load { args } { global gdb_prompt global verbose global GDB global user_spawn_id global spawn_id global qemu if { $args != "" } { if [gdb_file_cmd $args] then { return -1 } } if { $args == "{}"} { puts "No executable passed to GDB!" # Only the remote protocol is used with the QEMU's gdbserver support send_gdb "target extended-remote :2345\n" gdb_expect 2400 { -re ".*$gdb_prompt $" { if $verbose>1 then { send_user "Connected to QEMU target\n" } } -re "Remote debugging using .*$gdb_prompt $" { verbose "Set target to remote for QEMU" } timeout { if $verbose>1 then { perror "Timed out trying to connect to QEMU target." } } } # send_gdb "continue\n" } send_gdb "load\n" gdb_expect 2400 { -re ".*$gdb_prompt $" { if $verbose>1 then { send_user "Loaded $args into GDB\n" } close $spawn_id return 0 } -re "$gdb_prompt $" { if $verbose>1 then { perror "GDB couldn't load." } } timeout { if $verbose>1 then { perror "Timed out trying to load $args." } } } close $spawn_id return -1 } proc runto_main { } { global verbose global gdb_prompt send_gdb "continue\n" gdb_expect 2400 { -re ".*$gdb_prompt $" { if $verbose>1 then { send_user "Continuing QEMU target\n" } } timeout { if $verbose>1 then { perror "Timed out trying to connect to QEMU target." } } } return "" # return [runto main no-message] } dejagnu-1.6.3/baseboards/riscv-sim.exp0000644000000000000000000000366713714405561014606 00000000000000# Copyright (C) 1997-2019, 2020 Free Software Foundation, Inc. # # This file is part of DejaGnu. For RISC-V target simulation. # # 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 2 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. # Load the generic configuration for this board. This will define a basic # set of routines used to communicate with the board. load_generic_config "sim" # basic-sim.exp is a basic description for the standard Cygnus simulator. load_base_board_description "basic-sim" # This tells it which directory to look in for the simulator. setup_sim riscv # No multilib flags are set by default. process_multilib_options "" # The compiler used to build for this board. This has *nothing* to do # with what compiler is tested if we're testing gcc. set_board_info compiler "[find_gcc]" # The basic set of flags needed to build "hello world" for this # board. This board uses libgloss and newlib. set_board_info cflags "[libgloss_include_flags] [newlib_include_flags]" set_board_info ldflags "[libgloss_link_flags] [newlib_link_flags]" # This board doesn't use a linker script. set_board_info ldscript "" # And, it can't do arguments, and doesn't have real signals. set_board_info noargs 1 set_board_info gdb,nosignals 1 # skip gdb.reverse set_board_info gdb,can_reverse 0 set_board_info gdb,use_precord 0 # Setup the timeout set_board_info gcc,timeout 600 dejagnu-1.6.3/baseboards/rx-sim.exp0000644000000000000000000000302613676762721014111 00000000000000# Copyright (C) 2009-2016, 2019 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. # Contributed by DJ Delorie . set_board_info target_install {rx-elf} # No support for argument passing set_board_info noargs 1 # No support for signals either. set_board_info gdb,nosignals 1 # The simulator does not use the remote protocol, so it can't support the # remote protocol packets used by GDB's fileio.exp test. set_board_info gdb,nofileio 1 load_generic_config "sim" load_base_board_description "basic-sim" setup_sim rx process_multilib_options "" set_board_info cflags "[newlib_include_flags] -msim" set_board_info ldflags "[libgloss_link_flags] [newlib_link_flags]" # Used by a few gcc.c-torture testcases to delimit how large the stack can # be. Needed for the small integer multilibs. set_board_info gcc,stack_size 4096 dejagnu-1.6.3/baseboards/sh-sid.exp0000644000000000000000000000306113407073624014045 00000000000000# Copyright (C) 1997-2016 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. # This is a list of toolchains that are supported on this board. set_board_info target_install {sh-elf} # Load a baseboard description for SID simulators. load_base_board_description "basic-sid" process_multilib_options "" verbose "Using simulator [board_info $board sim]\n" set_board_info sim [find_rawsid] if { $tool eq "gdb" } { set_board_info sim,options "-f [find_sid_conf sh-gdb]" } else { set_board_info sim,options "-f [find_sid_conf sh-gloss]" } # Load the generic configuration for this board. This will define a basic set # of routines needed by the tool to communicate with the board. load_generic_config "sid" # default endian: big # set_board_info sim,defaultendian "-EB" # Tells the test harness to use pre-generated sid configurations. set_board_info sim,protocol "sid" dejagnu-1.6.3/baseboards/sh-sim.exp0000644000000000000000000000427313676762721014077 00000000000000# Copyright (C) 2003-2016, 2019 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. # This is a list of toolchains that are supported on this board. set_board_info target_install {sh-elf} # Load the generic configuration for this board. This will define a basic set # of routines needed by the tool to communicate with the board. load_generic_config "sim" # basic-sim.exp is a basic description for the standard simulator. load_base_board_description "basic-sim" # "sh" is the name of the sim subdir. setup_sim sh # No multilib options needed by default. process_multilib_options "" # We only support newlib on this target. We assume that all multilib # options have been specified before we get here. set_board_info cflags "[libgloss_include_flags] [newlib_include_flags]" set_board_info ldflags "[libgloss_link_flags] [newlib_link_flags]" # No linker script needed. set_board_info ldscript "" verbose "Using simulator [board_info $board sim]\n" # Prints to stdout OK. # Returns exit status OK (does not need status wrapper). # Passes argc, argv OK. # Calls functions OK. # No signals. set_board_info gdb,nosignals 1 # Used by a few gcc.c-torture testcases to delimit how large the stack # can be. set_board_info gcc,stack_size 16384 # Need to pass -mieee in order to for the compiler to be IEEE-fp compliant. set_board_info ieee_multilib_flags "-mieee" # Small memory, can't do gdb's "huge.exp" test. set_board_info gdb,skip_huge_test 1 # Nor are interrupts really working. set_board_info gdb,nointerrupts 1 dejagnu-1.6.3/baseboards/sparc-sim.exp0000644000000000000000000000367613676762721014603 00000000000000# Copyright (C) 1997-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. # This is a list of toolchains that are supported on this board. set_board_info target_install {sparc-elf} # Load the generic configuration for this board. This will define a # set of generic routines used by the tool to communicate with the # board. load_generic_config "sim" # basic-sim.exp is a basic description for the standard Cygnus simulator. load_base_board_description "basic-sim" # This tells it which directory to look in for the simulator. setup_sim erc32 # It needs no multilib flags by default. process_multilib_options "" set_board_info cflags "[newlib_include_flags] [libgloss_include_flags]" set_board_info ldflags "-nostdlib -nostartfiles [libgloss_link_flags] [newlib_link_flags]" # ELF simulator linker script. set_board_info ldscript "-Telfsim.ld" # The simulator doesn't return exit statuses and we need to indicate this. set_board_info needs_status_wrapper 1 # We can't pass arguments. set_board_info noargs 1 # Or do signals. set_board_info gdb,nosignals 1 # We want to specify the sparclite emulator in GDB. #set_board_info gdb,target_sim_options "-sparclite" # Pass -a -sparclite to the standalone simulator #set_board_info sim,options "-a -sparclite" dejagnu-1.6.3/baseboards/sparc64-sim.exp0000644000000000000000000000355113676762721014745 00000000000000# Copyright (C) 1997-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. # This is a list of toolchains that are supported on this board. set_board_info target_install {sparc64-elf} # Load the generic configuration for this board. This will define any # routines needed by the tool to communicate with the board. load_generic_config "sim" # We need this for find_gcc and *_include_flags/*_link_flags. load_base_board_description "basic-sim" # Use long64 by default. process_multilib_options "long64" setup_sim sparc64 # We only support newlib on this target. We assume that all multilib # options have been specified before we get here. set_board_info cflags "[libgloss_include_flags] [newlib_include_flags]" set_board_info ldflags "[libgloss_link_flags] [newlib_link_flags]" # No linker script. set_board_info ldscript "" # Used by a few gcc.c-torture testcases to delimit how large the stack can # be. set_board_info gcc,stack_size 16384 # The simulator doesn't return exit statuses and we need to indicate this; # the standard GCC wrapper will work with this target. set_board_info needs_status_wrapper 1 # We can't pass arguments to programs. set_board_info noargs 1 dejagnu-1.6.3/baseboards/sparclite-sim-le.exp0000644000000000000000000000440713676762721016050 00000000000000# Copyright (C) 1997-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. # This is a list of toolchains that are supported on this board. set_board_info target_install {sparclite-elf} # Load the generic configuration for this board. This will define a # set of generic routines used by the tool to communicate with the # board. load_generic_config "sim" # basic-sim.exp is a basic description for the standard Cygnus simulator. load_base_board_description "basic-sim" if {![info exists board_info($board,multilib_flags)]} { set board_info($board,multilib_flags) "-mlittle-endian-data" } # This tells it which directory to look in for the simulator. setup_sim erc32 # It needs no multilib flags by default. process_multilib_options "" set_board_info cflags "[newlib_include_flags] [libgloss_include_flags]" set_board_info ldflags "-nostdlib -nostartfiles [libgloss_link_flags] [newlib_link_flags]" # ELF simulator linker script. set_board_info ldscript "-Telfsim.ld" # The simulator doesn't return exit statuses and we need to indicate this. set_board_info needs_status_wrapper 1 # We use a GDB stub to talk to the board. # set_board_info use_gdb_stub 1 # For GDB, we need to use a real stub (not the separate loader scheme # we use for Sparclet). # set_board_info gdb_stub "" # No mathlib. # set_board_info mathlib "" # We can't do I/O in GDB. # set_board_info gdb,noinferiorio 1 # Or pass arguments. set_board_info noargs 1 # Or do signals. set_board_info gdb,nosignals 1 #We want to specify the sparclite emulator in GDB. set_board_info gdb,target_sim_options "-sparclite" dejagnu-1.6.3/baseboards/sparclite-sim.exp0000644000000000000000000000370013676762721015445 00000000000000# Copyright (C) 1997-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. # This is a list of toolchains that are supported on this board. set_board_info target_install {sparclite-elf} # Load the generic configuration for this board. This will define a # set of generic routines used by the tool to communicate with the # board. load_generic_config "sim" # basic-sim.exp is a basic description for the standard Cygnus simulator. load_base_board_description "basic-sim" # This tells it which directory to look in for the simulator. setup_sim erc32 # It needs no multilib flags by default. process_multilib_options "" set_board_info cflags "[newlib_include_flags] [libgloss_include_flags]" set_board_info ldflags "-nostdlib -nostartfiles [libgloss_link_flags] [newlib_link_flags]" # ELF simulator linker script. set_board_info ldscript "-Telfsim.ld" # The simulator doesn't return exit statuses and we need to indicate this. set_board_info needs_status_wrapper 1 # We can't pass arguments. set_board_info noargs 1 # Or do signals. set_board_info gdb,nosignals 1 # We want to specify the sparclite emulator in GDB. set_board_info gdb,target_sim_options "-sparclite" # Pass -a -sparclite to the standalone simulator set_board_info sim,options "-a -sparclite" dejagnu-1.6.3/baseboards/tx39-sim.exp0000644000000000000000000000164013407073624014254 00000000000000# Copyright (C) 1997-2016 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. # This file is unnecessary, but we'll keep it for now. # We're the same as the standard MIPS simulator. load_base_board_description "mips-sim" dejagnu-1.6.3/baseboards/unix.exp0000644000000000000000000000240613676762721013656 00000000000000# Copyright (C) 1997-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. # The canonical unix board description. load_generic_config "unix" process_multilib_options "" set_board_info bmk,use_alarm 1 # Do not use -lm on Cygwin if { [istarget "*-*-cygwin*"] } { set_board_info mathlib "" } # For the alpha, force use ieee if { [istarget "alpha*-*"] } { set_board_info ieee_multilib_flags "-mieee" } # Hardware breakpoints are not supported in sparc64 on GNU/Linux if { [istarget "sparc64-*-linux-gnu"] } { set_board_info gdb,no_hardware_watchpoints 1 } dejagnu-1.6.3/baseboards/v850-sim.exp0000644000000000000000000000350613676762721014165 00000000000000# Copyright (C) 1997-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. # This is a list of toolchains that are supported on this board. set_board_info target_install {v850-elf v850e-elf} # Load the generic configuration for this board. This will define any # routines needed by the tool to communicate with the board. load_generic_config "sim" # We need this for find_gcc and *_include_flags/*_link_flags. load_base_board_description "basic-sim" # No multilib flags needed for this target. process_multilib_options "" setup_sim v850 # We only support newlib on this target. We assume that all multilib # options have been specified before we get here. set_board_info cflags "[libgloss_include_flags] [newlib_include_flags]" set_board_info ldflags "[libgloss_link_flags] [newlib_link_flags]" # DDB linker script. set_board_info ldscript "" # The simulator doesn't return exit statuses and we need to indicate this; # the standard GCC wrapper will work with this target. set_board_info needs_status_wrapper 1 # We can't pass arguments to programs. set_board_info noargs 1 # And we don't support signals. set_board_info gdb,nosignals 1 dejagnu-1.6.3/baseboards/visium-sim.exp0000644000000000000000000000314013676762721014771 00000000000000# Copyright (C) 2013-2016, 2019 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. # This is a list of toolchains that are supported on this board. set_board_info target_install {visium-elf} # Load the generic configuration for this board, This will define a basic # set of routines needed by the tool to communicate with the board. load_generic_config "sim" # basic-sim.exp is a basic description for the simulator. load_base_board_description "basic-sim" # The name of the simulator is "visium". setup_sim visium # No multilib flags needed by default. process_multilib_options "" set_board_info cflags "[libgloss_include_flags] [newlib_include_flags]" set_board_info ldflags "-msim [libgloss_link_flags] [newlib_link_flags]" # No support for signals on this target. set_board_info gdb,nosignals 1 # Used by a few gcc.c-torture testcases to delimit how large the stack can be. set_board_info gcc,stack_size 65536 dejagnu-1.6.3/baseboards/vr4100-sim.exp0000644000000000000000000000215613407073624014404 00000000000000# Copyright (C) 1997-2016 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. # DDB linker script. if { [board_info $board obj_format] eq "ecoff" } { set_board_info ldscript "-Tddbecoff.ld" } else { set_board_info ldscript "-Tddb.ld" } # And the simulator doesn't reliably return exit statuses. set_board_info needs_status_wrapper 1 # Otherwise, we're a standard MIPS config. load_base_board_description "mips64-sim" dejagnu-1.6.3/baseboards/vr4111-sim.exp0000644000000000000000000000215613407073624014406 00000000000000# Copyright (C) 1997-2016 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. # DDB linker script. if { [board_info $board obj_format] eq "ecoff" } { set_board_info ldscript "-Tddbecoff.ld" } else { set_board_info ldscript "-Tddb.ld" } # And the simulator doesn't reliably return exit statuses. set_board_info needs_status_wrapper 1 # Otherwise, we're a standard MIPS config. load_base_board_description "mips64-sim" dejagnu-1.6.3/baseboards/vr4300-sim.exp0000644000000000000000000000215613407073624014406 00000000000000# Copyright (C) 1997-2016 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. # DDB linker script. if { [board_info $board obj_format] eq "ecoff" } { set_board_info ldscript "-Tddbecoff.ld" } else { set_board_info ldscript "-Tddb.ld" } # And the simulator doesn't reliably return exit statuses. set_board_info needs_status_wrapper 1 # Otherwise, we're a standard MIPS config. load_base_board_description "mips64-sim" dejagnu-1.6.3/baseboards/xtensa-sim.exp0000644000000000000000000000314713676762721014766 00000000000000# Copyright (C) 1997-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. # This is a list of toolchains that are supported on this board. set_board_info target_install {xtensa-elf} # Load the generic configuration for this board. This will define any # routines needed to communicate with the board. load_generic_config "sim" # We don't use basic-sim.exp and setup_sim because the simulator, called # "xt-run", is external to the build tree. set_board_info sim xt-run set_board_info sim,options "--turbo --exit_with_target_code" set_board_info is_simulator 1 # No default multilib options are needed for this board. process_multilib_options "" set_board_info cflags "[libgloss_include_flags] [newlib_include_flags]" set_board_info ldflags "[libgloss_link_flags] [newlib_link_flags]" # No linker script needed. set_board_info ldscript "" # No support for signals on this target. set_board_info gdb,nosignals 1 dejagnu-1.6.3/commands/0000755000000000000000000000000014062534646011720 500000000000000dejagnu-1.6.3/commands/help.sh0000644000000000000000000000567514052341122013121 00000000000000#!/bin/sh # help.sh -- "dejagnu help" command # # Copyright (C) 2018, 2021 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. # ##help # #Usage: dejagnu help [ OPTIONS... ] COMMAND # # --verbose, -v Emit additional messages # # --path, -w Passed to man(1) # # -W Passed to man(1) # ##end # shellcheck disable=SC2003 # The shellcheck tool complains about use of expr and recommends using # newer shell features instead. Solaris 10 /bin/sh does not support the # newer features, so we must use expr in this script. # shellcheck disable=SC2006 # The shellcheck tool complains about the old style backtick command # substitution. Solaris 10 /bin/sh does not support the new style $() # command substitution and the usage of command substitution in this script # is simple enough to work. Most notably, nesting backtick command # substitution is tricky, but we do not do that. # This script was written by Jacob Bachmeyer. # For testing and development in_test_mode=false if test x"$1" = x--DGTest ; then in_test_mode=true shift fi args= command=dejagnu verbose=0 for a in "$@"; do case $a in -v|--v|-verb*|--verb*) verbose=`expr $verbose + 1` ;; -w|-W|--path) args="${args} ${a}" ;; -*) echo Unrecognized option "\"$a\"" ;; *) command="${command}-${a}" ;; esac done if expr "$verbose" \> 0 > /dev/null ; then echo Verbose level is $verbose fi ## Get the location of this script and check for nearby "doc" dir. commdir=`echo "$0" | sed -e 's@/[^/]*$@@'` docdir=`echo "$commdir" | sed -e 's@/[^/]*$@@'`/doc if expr "$verbose" \> 0 > /dev/null ; then echo Running from "$commdir" if expr "$verbose" \> 1 > /dev/null ; then echo Probing "$docdir" fi fi if test -d "$docdir"; then if expr "$verbose" \> 1 > /dev/null ; then echo Probing "${docdir}/${command}.1" fi if test -r "${docdir}/${command}.1" ; then command="${docdir}/${command}.1" fi fi # Word splitting on the "args" variable is intended. # Globbing is not, but ensure that verbose output will show the problem. if expr "$verbose" \> 0 > /dev/null ; then #shellcheck disable=SC2086 echo Forwarding to man $args "\"$command\"" fi if $in_test_mode ; then echo man "$args $command" else #shellcheck disable=SC2086 exec man $args "$command" fi #EOF dejagnu-1.6.3/commands/report-card.awk0000644000000000000000000001531114035717456014571 00000000000000# report-card.awk -- Test summary tool # Copyright (C) 2018, 2021 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. # This file was written by Jacob Bachmeyer. # ##help # #Usage: dejagnu report card [ OPTION | TOOL | FILE ]... # #Usage: dejagnu report-card [ OPTION | TOOL | FILE ]... # # --verbose, -v Emit additional messages # ##end # Arrays storing lists in this program store items in numbered keys, with a # count in the "C" key, similar to Awk's ARGV/ARGC. # The Tools array stores a list of tools in 1..N. # The Passes array stores a global list of passes seen, a per-tool list of # passes seen, and a global index of passes seen if DejaGnu's multipass # support is used. # Key prefixes: # "" -- global list: 1..N; "C" # "t", -- per-tool list: 1..N; "C" # Key patterns: # "p", -- count of tools using # The Totals array stores counts of test results, indexed by tool and pass. # A summarization step adds per-tool, per-pass, and grand totals. # Key patterns: # "tp", , , # "t", , # "p", , # ## ## Get list of files to scan BEGIN { Tools["C"] = 1 Passes["", "C"] = 1 ToolWidth = 0 PassWidth = 0 Verbose = 0 # remove arguments from ARGV for (i = 1; i < ARGC; i++) { if (ARGV[i] ~ /^-/) { if (ARGV[i] ~ /^--?v(erb.*)?$/) Verbose++ else if (ARGV[i] == "--") break delete ARGV[i] } } if (ARGV[i] == "--") delete ARGV[i] if (Verbose) print "Verbose level is "Verbose # adjust filenames in ARGV FileCount = 0 for (i = 1; i < ARGC; i++) { if (i in ARGV) FileCount++ else continue if (ARGV[i] ~ /\.sum$/) continue else if (ARGV[i] ~ /\.log$/) sub(/\.log$/, ".sum", ARGV[i]) else if (ARGV[i] ~/\.$/) sub(/\.$/, ".sum", ARGV[i]) else ARGV[i] = (ARGV[i]".sum") } if (FileCount == 0) { cmd_ls_files = "ls -1 *.sum" while (cmd_ls_files | getline File) { FileCount++ ARGV[ARGC++] = File } close(cmd_ls_files) } if (Verbose > 2) { print "Reading "FileCount" file(s)" for (i = 1; i < ARGC; i++) if (i in ARGV) print " "ARGV[i] } } ## ## Read files and collect data FNR == 1 { if (Verbose) print "Reading `"FILENAME"' ..." Pass = "" Tool = File = FILENAME sub(/\.sum$/, "", Tool) if (length(Tool) > ToolWidth) ToolWidth = length(Tool) Tools[Tools["C"]++] = Tool Passes["t", Tool, "C"] = 1 Passes["t", Tool, 1] = "" # will be overwritten if multipass is used } /^Running pass `[^']*' .../ { Pass = $3 sub(/^`/, "", Pass) sub(/'$/, "", Pass) if (("p", Pass) in Passes) Passes["p", Pass]++ else { if (length(Pass) > PassWidth) PassWidth = length(Pass) Passes["", Passes["", "C"]++] = Pass Passes["p", Pass] = 1 } Passes["t", Tool, Passes["t", Tool, "C"]++] = Pass } $1 ~ /:$/ { sub(/:$/, "", $1); Totals["tp", Tool, Pass, $1]++ } ## ## Compute totals END { $0 = ("PASS FAIL KPASS KFAIL XPASS XFAIL UNSUPPORTED UNRESOLVED UNTESTED") for (i = 1; i in Tools; i++) for (j = 1; ("t", Tools[i], j) in Passes; j++) for (k = 1; k <= NF; k++) { Totals[$k] \ += Totals["tp", Tools[i], Passes["t", Tools[i], j], $k] Totals["t", Tools[i], $k] \ += Totals["tp", Tools[i], Passes["t", Tools[i], j], $k] Totals["p", Passes["t", Tools[i], j], $k] \ += Totals["tp", Tools[i], Passes["t", Tools[i], j], $k] } } ## ## Compute total name column width END { if (Passes["", "C"] > 1) NameWidth = ToolWidth + 3 + PassWidth else NameWidth = ToolWidth } ## ## Emit header END { printf "%*s __________________________________________________\n", \ NameWidth, "" printf "%*s / %6s %6s %6s %6s %6s %6s %6s\n", NameWidth, "", \ "PASS", "FAIL", "?PASS", "?FAIL", "UNSUP", "UNRES", "UNTEST" printf "%*s |--------------------------------------------------\n", \ NameWidth, "" } ## ## Emit counts END { for (i = 1; i in Tools; i++) { Tool = Tools[i] for (j = 1; ("t", Tool, j) in Passes; j++) { Pass = Passes["t", Tool, j] if (Passes["t", Tool, "C"] > 1) printf "%*s / %-*s | ", ToolWidth, Tool, PassWidth, Pass else if (Passes["", "C"] > 1) printf "%*s %*s | ", ToolWidth, Tool, PassWidth, "" else printf "%*s | ", NameWidth, Tool # Passes["t", , 1] is a pass name or a null string if # did not use multipass. printf " %6d %6d %6d %6d %6d %6d %6d%s%s\n", \ Totals["tp", Tool, Pass, "PASS"], \ Totals["tp", Tool, Pass, "FAIL"], \ Totals["tp", Tool, Pass, "KPASS"] \ + Totals["tp", Tool, Pass, "XPASS"], \ Totals["tp", Tool, Pass, "KFAIL"] \ + Totals["tp", Tool, Pass, "XFAIL"], \ Totals["tp", Tool, Pass, "UNSUPPORTED"], \ Totals["tp", Tool, Pass, "UNRESOLVED"], \ Totals["tp", Tool, Pass, "UNTESTED"], \ (Totals["tp", Tool, Pass, "ERROR" ] > 0 ? " !E!" : ""), \ (Totals["tp", Tool, Pass, "WARNING"] > 0 ? " !W!" : "") } } } ## ## Emit pass totals END { if (Passes["", "C"] > 1) { printf "%*s |--------------------------------------------------\n", \ NameWidth, "" for (i = 1; ("", i) in Passes; i++) printf "%*s %-*s | %6d %6d %6d %6d %6d %6d %6d\n", \ ToolWidth, "", PassWidth, Passes["", i], \ Totals["p", Passes["", i], "PASS"], \ Totals["p", Passes["", i], "FAIL"], \ Totals["p", Passes["", i], "KPASS"] \ + Totals["p", Passes["", i], "XPASS"], \ Totals["p", Passes["", i], "KFAIL"] \ + Totals["p", Passes["", i], "XFAIL"], \ Totals["p", Passes["", i], "UNSUPPORTED"], \ Totals["p", Passes["", i], "UNRESOLVED"], \ Totals["p", Passes["", i], "UNTESTED"] } } ## ## Emit grand totals END { printf "%*s |--------------------------------------------------\n", \ NameWidth, "" printf "%*s | %6d %6d %6d %6d %6d %6d %6d\n", NameWidth, "", \ Totals["PASS"], Totals["FAIL"], \ Totals["KPASS"] + Totals["XPASS"], Totals["KFAIL"] + Totals["XFAIL"], \ Totals["UNSUPPORTED"], Totals["UNRESOLVED"], Totals["UNTESTED"] printf "%*s \\__________________________________________________\n", \ NameWidth, "" } #EOF dejagnu-1.6.3/config/0000755000000000000000000000000014062534646011364 500000000000000dejagnu-1.6.3/config/README0000644000000000000000000000235613407073624012166 00000000000000The files in this directory define a basic set of functionality for each board. They are loaded by calling "load_generic_config", normally done as part of the baseboard description for a given board. This functionality is a partial replacement for the tool-specific configuration previously found in the testsuite/config directory. Note that no tool-specific actions are defined here; they still need to be defined by the tool-specific config files. However, for tools that simply wish to download and execute programs on a board, the functionality here should be sufficient. The functions that can be defined are: ${board}_open ${board}_close ${board}_exec ${board}_binary ${board}_reboot ${board}_download ${board}_upload ${board}_transmit ${board}_send ${board}_file ${board}_spawn ${board}_load Normally these functions are invoked indirectly by the testcases when they invoke the remote_xxx version of the function. The ${board}_xxx functions will be called in preference to the default versions (or the ones specified by the "connect" protocol in the board description). However, the version defined by the "connect" protocol are still accessible by calling remote_raw_xxx, which will ignore any board-specific or generic versions of these functions. dejagnu-1.6.3/config/adb.exp0000644000000000000000000001207013407073624012544 00000000000000# Copyright (C) 2013-2016 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 2 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # # Get serial number in case of multiple devices # proc adb_serial {} { # If the user has ADB_SERIAL set, use that, otherwise default to the # only device. set serial "[getenv ADB_SERIAL]" if { $serial eq "" } { set status [catch "exec adb devices |& wc -l" output] if { $output > 3 } { perror "Set ADB_SERIAL in your environment to specify the correct target device!" } return "" } else { return "-s $serial" } } # # Connect to hostname using adb # proc adb_open { hostname } { global spawn_id set tries 0 set result -1 if {[board_info $hostname exists shell_prompt]} { set shell_prompt [board_info $hostname shell_prompt] } else { set shell_prompt "root@android:/ # " } if {[board_info $hostname exists fileid]} { unset board_info($hostname,fileid) } set serial [adb_serial] if { $serial ne "" } { spawn adb [adb_serial] shell } else { spawn adb shell } if { $spawn_id < 0 } { perror "invalid spawn id from adb" return -1 } send "\r\n" while { $tries <= 3 } { expect { -re ".*$shell_prompt.*$" { verbose "Got prompt\n" set result 0 break } timeout { warning "adb shell: timed out trying to connect." } eof { perror "adb shell: got EOF while trying to connect." break } } incr tries } if { $result < 0 } { # perror "adb shell: couldn't connect after $tries tries." catch "close -i $spawn_id" set spawn_id -1 } else { set board_info($hostname,fileid) $spawn_id } return $spawn_id } # # Download $srcfile to $destfile on $desthost. # proc adb_download {desthost srcfile destfile} { set serial [adb_serial] verbose "Removing old executable: adb $serial shell rm $destfile" 3 set status [catch "exec adb $serial shell rm $destfile |& cat" output] verbose "Downloading: adb $serial shell push $srcfile $destfile" 3 set status [catch "exec adb $serial push $srcfile $destfile |& cat" output] if { $status == 0 } { verbose "Copied $srcfile to $destfile" 2 return $destfile } else { verbose "Download to target failed, $output." return "" } } proc adb_file {dest op args} { set file [lindex $args 0] verbose "Executing command: $op $args" 2 switch -- $op { exists { set status [catch "exec adb [adb_serial] shell ls |& cat" out] } delete { set status [catch "exec adb [adb_serial] shell rm $file |& cat" rmout] } } return [eval remote_raw_file \"$dest\" \"$op\" $args] } proc adb_upload {desthost srcfile destfile} { set status [catch "exec adb [adb_serial] pull $srcfile $destfile |& cat" output] if { $status == 0 } { verbose "Copied $srcfile to $destfile" 2 return $destfile } else { verbose "Upload from $desthost failed, $output." return "" } } # # Execute "$cmd $args[0]" on $boardname. # proc adb_exec { boardname cmd args } { global remove_test if { [llength $args] > 0 } { set pargs [lindex $args 0] if { [llength $args] > 1 } { set inp [lindex $args 1] } else { set inp "" } } else { set pargs "" set inp "" } # If CMD sends any output to stderr, exec will think it failed. More often # than not that will be true, but it doesn't catch the case where there is # no output but the exit code is non-zero. if { $inp eq "" } { set inp "/dev/null" } verbose "Executing on $boardname: $cmd $pargs < $inp" # Execute commands only from temporary folder, therefore do "cd" first global android_tmp_dir set status [catch "exec cat $inp | adb [adb_serial] shell cd $android_tmp_dir \&\& \( $cmd $pargs \) \\; echo XYZ\\\$\\\{\?\\\}ZYX |& cat" output] # `status' doesn't mean much here other than adb worked ok. # What we want is whether $cmd ran ok. if { $status != 0 } { regsub "XYZ(\[0-9\]*)ZYX\n?" $output "" output return [list -1 "adb to $boardname failed for $cmd, $output"] } regexp "XYZ(\[0-9\]*)ZYX" $output junk status verbose "adb_exec: status:$status text:$output" 4 if { $status eq "" } { return [list -1 "Couldn't parse adb output, $output."] } regsub "XYZ(\[0-9\]*)ZYX\n?" $output "" output # Delete one trailing \n because that is what `exec' will do and we want # to behave identical to it. regsub "\n$" $output "" output return [list [expr {$status != 0}] $output] } dejagnu-1.6.3/config/aarch64-fv8.exp0000644000000000000000000000331013407073624013744 00000000000000# Copyright (C) 2016 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. # This initializes the path to the Foundation Model proc ${board}_init { hostname } { global model # Get the full path to the Foundation Model if {[board_info $hostname exists model]} { set model "[board_info $hostname model]" } } proc ${board}_download { dest file args } { global model timeout # Extract the endianess of the executable set status [catch "exec od -An -v -j5 -N1 -t x1 $file" bigendian] set args "--quiet" if { $bigendian eq "02"} { set args "$args --bigendian" } set result [local_exec "$model --image $file $args" "" "" $timeout] set status [lindex $result 0] set output [lindex $result 1] if { $status == 0 } { verbose "Executed $file on $model" 2 return $file } else { verbose "Download to $model failed, $output." return "" } } proc ${board}_exec { dest file args } { # This is a stub, since we can't execute remote commands on bare metal return 0 } dejagnu-1.6.3/config/default.exp0000644000000000000000000000221213407073624013437 00000000000000# Copyright (C) 1992-2016 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. # This file was written by Rob Savoye . proc ${tool}_version { } { verbose "WARNING: Using the default proc for tool_version" 2 } proc ${tool}_exit {} { verbose "WARNING: Using the default proc for tool_exit" 2 } proc ${tool}_start { } { global spawn_id verbose "WARNING: Using the default proc for tool_start" 2 return $spawn_id } dejagnu-1.6.3/config/gdb-comm.exp0000644000000000000000000003662613407073625013521 00000000000000# Copyright (C) 1992-2016 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. # Note: some of this was cribbed from the gdb testsuite since we need # to use some pretty standard gdb features (breakpoints in particular). # Load up some standard junk. load_lib remote.exp if {![info exists board]} { perror "$board must be set before loading gdb-comm" } # The number of times we've tried to download/execute this executable. set try_again 0 # # Delete all breakpoints and verify that they were deleted. If anything # goes wrong, return -1. # proc gdb_comm_delete_breakpoints {} { global gdb_prompt remote_send host "delete breakpoints\n" remote_expect host 10 { -re "Delete all breakpoints.*y or n. $" { remote_send host "y\n" exp_continue } -re ".*$gdb_prompt $" { } timeout { perror "Delete all breakpoints (timeout)" ; return -1} } remote_send host "info breakpoints\n" remote_expect host 10 { -re "No breakpoints or watchpoints..*$gdb_prompt $" {} -re ".*$gdb_prompt $" { perror "breakpoints not deleted" ; return -1} timeout { perror "info breakpoints (timeout)" ; return -1} } return 0 } # # Inform the debugger that we have a new exec file. # return a -1 if anything goes wrong, 0 on success. # proc gdb_comm_file_cmd { arg } { global verbose global loadpath global loadfile global GDB global gdb_prompt upvar timeout timeout # The "file" command loads up a new symbol file for gdb, deal with # the various messages it might spew out. if {[isremote host]} { set arg [remote_download host $arg a.out] } remote_send host "file $arg\n" remote_expect host 60 { -re "Reading symbols from.*done.*$gdb_prompt $" { verbose "\t\tLoaded $arg into the $GDB" return 0 } -re "has no symbol-table.*$gdb_prompt $" { perror "$arg wasn't compiled with \"-g\"" return -1 } -re "A program is being debugged already.*Kill it.*y or n. $" { remote_send host "y\n" verbose "\t\tKilling previous program being debugged" exp_continue } -re {Load new symbol table from ".*".*y or n.*$} { remote_send host "y\n" remote_expect host 60 { -re "Reading symbols from.*done.*$gdb_prompt $" { verbose "\t\tLoaded $arg with new symbol table into $GDB" return 0 } timeout { perror "(timeout) Couldn't load $arg, other program already loaded." return -1 } } } -re ".*No such file or directory.*$gdb_prompt $" { perror "($arg) No such file or directory\n" return -1 } -re "$gdb_prompt $" { perror "couldn't load $arg into $GDB." return -1 } timeout { perror "couldn't load $arg into $GDB (timed out)." return -1 } eof { # This is an attempt to detect a core dump, but seems not to # work. Perhaps we need to match .* followed by eof, in which # expect does not seem to have a way to do that. perror "couldn't load $arg into $GDB (end of file)." return -1 } } return 0 } # Disconnect from the target and forget that we have an executable. Returns # -1 on failure, 0 on success. proc gdb_comm_go_idle { } { global gdb_prompt if {![board_info host exists fileid]} { return -1 } remote_send host "target exec\n" remote_expect host 10 { -re "Kill it.*y or n.*$" { remote_send host "y\n" exp_continue } -re "No exec.* file now.*$gdb_prompt $" { return 0 } default { remote_close host return -1 } } } # Start GDB running with target DEST. proc gdb_comm_start { dest } { global GDB global gdb_prompt global tool_root_dir # The variable gdb_prompt is a regexp which matches the gdb prompt. Set it # if it is not already set. if {![board_info $dest exists gdb_prompt]} then { set gdb_prompt {\(gdb\)} } else { set gdb_prompt [board_info $dest gdb_prompt] } # Similarly for GDB. Look in the object directory for gdb if we aren't # provided with one. if {![info exists GDB]} then { set GDB "[lookfor_file $tool_root_dir gdb/gdb]" if { $GDB eq "" } { set GDB [transform gdb] } } if {[board_info host exists gdb_opts]} { set gdb_opts [board_info host gdb_opts] } else { set gdb_opts "" } # Start up gdb (no startfiles, no windows) and wait for a prompt. remote_spawn host "$GDB $gdb_opts -nw -nx" remote_expect host 60 { -re ".*$gdb_prompt $" { } } remote_send host "set height 0\n" remote_expect host 10 { -re ".*$gdb_prompt $" {} } remote_send host "set width 0\n" remote_expect host 10 { -re ".*$gdb_prompt $" {} } } # Add a breakpoint at function FUNCTION. We assume that GDB has already been # started. proc gdb_comm_add_breakpoint { function } { global gdb_prompt remote_send host "break $function\n" remote_expect host 60 { -re "Breakpoint.*$gdb_prompt $" { return "" } -re "Function.*not defined.*$gdb_prompt $" { return "undef" } -re "No symbol table.*$gdb_prompt $" { return "undef" } -re {.*Make breakpoint pending.*\? \(y or \[n\]\) $} { remote_send host "y\n" return "maybe" } default { return "untested" } } } # # quit_gdb -- try to quit GDB gracefully # proc quit_gdb { } { global gdb_prompt set spawn_id [board_info host fileid] if { $spawn_id ne "" && $spawn_id > -1 } { if { [remote_send host "quit\n"] eq "" } { remote_expect host 10 { -re ".*y or n.*$" { remote_send host "y\n" exp_continue } -re {.*[*][*][*].*EXIT code} { } default { } } } } if {![isremote host]} { remote_close host } } proc gdb_comm_leave { } { if {[isremote host]} { quit_gdb } else { gdb_comm_go_idle } } # # gdb_comm_load -- load the program and execute it # # PROG is a full pathname to the file to load, no arguments. # Result is "untested", "pass", "fail", etc. # proc gdb_comm_load { dest prog args } { global GDB global GDBFLAGS global gdb_prompt global timeout set argnames { "command-line arguments" "input file" "output file" } for { set x 0 } { $x < [llength $args] } { incr x } { if { [lindex $args $x] ne "" } { return [list "unsupported" "no support for [lindex $argnames $x] on this target"] } } # Make sure the file we're supposed to load really exists. if {![file exists $prog]} then { perror "$prog does not exist." return [list "untested" ""] } if { [isremote host] || ![board_info host exists fileid] } { gdb_comm_start $dest } # Remove all breakpoints, then tell the debugger that we have # new exec file. if { [gdb_comm_delete_breakpoints] != 0 } { gdb_comm_leave return [gdb_comm_reload $dest $prog $args] } if { [gdb_comm_file_cmd $prog] != 0 } { gdb_comm_leave return [gdb_comm_reload $dest $prog $args] } if {[board_info $dest exists gdb_sect_offset]} { set textoff [board_info $dest gdb_sect_offset] remote_send host "sect .text $textoff\n" remote_expect host 10 { -re {(0x[0-9a-z]+) - 0x[0-9a-z]+ is \.data} { set dataoff $expect_out(1,string) exp_continue } -re {(0x[0-9a-z]+) - 0x[0-9a-z]+ is \.bss} { set bssoff $expect_out(1,string) exp_continue } -re $gdb_prompt { } } set dataoff [format 0x%x [expr {$dataoff + $textoff}]] set bssoff [format 0x%x [expr {$bssoff + $textoff}]] remote_send host "sect .data $dataoff\n" remote_expect host 10 { -re $gdb_prompt { } } remote_send host "sect .bss $bssoff\n" remote_expect host 10 { -re $gdb_prompt { } } } set protocol [board_info $dest gdb_protocol] if {[board_info $dest exists gdb_serial]} { set targetname [board_info $dest gdb_serial] } elseif {[board_info $dest exists netport]} { set targetname [board_info $dest netport] } else { if {[board_info $dest exists serial]} { set targetname [board_info $dest serial] } else { set targetname "" } } if {[board_info $dest exists baud]} { remote_send host "set remotebaud [board_info $dest baud]\n" remote_expect host 10 { -re ".*$gdb_prompt $" {} default { warning "failed setting baud rate" } } } remote_send host "target $protocol $targetname\n" remote_expect host 60 { -re "Couldn.t establish conn.*$gdb_prompt $" { warning "Unable to connect to $targetname with GDB." quit_gdb return [gdb_comm_reload $dest $prog $args] } -re "Ending remote.*$gdb_prompt $" { warning "Unable to connect to $targetname with GDB." quit_gdb return [gdb_comm_reload $dest $prog $args] } -re "Remote target $protocol connected to.*$gdb_prompt $" { } -re "Remote target $targetname connected to.*$gdb_prompt $" { } -re "Connected to ARM RDI target.*$gdb_prompt $" { } -re "Connected to the simulator.*$gdb_prompt $" { } -re "Remote.*using $targetname.*$gdb_prompt $" { } -re "$gdb_prompt $" { warning "Unable to connect to $targetname with GDB." quit_gdb return [gdb_comm_reload $dest $prog $args] } -re ".*RDI_open.*should reset target.*" { warning "RDI Open Failed" quit_gdb return [gdb_comm_reload $dest $prog $args] } default { warning "Unable to connect to $targetname with GDB." quit_gdb return [gdb_comm_reload $dest $prog $args] } } if {[target_info exists gdb_init_command]} { remote_send host "[target_info gdb_init_command]\n" remote_expect host 10 { -re ".*$gdb_prompt $" { } default { gdb_comm_leave return [list "fail" ""] } } } # Now download the executable to the target board. If communications # with the target are very slow the timeout might need to be increased. if {[board_info $dest exists gdb_load_offset]} { remote_send host "load $prog [board_info $dest gdb_load_offset]\n" } else { remote_send host "load\n" } remote_expect host 600 { -re "text.*data.*$gdb_prompt $" { } -re "data.*text.*$gdb_prompt $" { } -re "$gdb_prompt $" { warning "Unable to send program to target board." gdb_comm_leave return [gdb_comm_reload $dest $prog $args] } default { warning "Unable to send program to target board." gdb_comm_leave return [gdb_comm_reload $dest $prog $args] } } # Now set up breakpoints in exit, _exit, and abort. These # are used to determine if a c-torture test passed or failed. More # work would be necessary for things like the g++ testsuite which # use printf to indicate pass/fail status. if { [gdb_comm_add_breakpoint _exit] ne "" } { gdb_comm_add_breakpoint exit } gdb_comm_add_breakpoint abort set output "" # Now start up the program and look for our magic breakpoints. # And a whole lot of other magic stuff too. if {[board_info $dest exists gdb_run_command]} { remote_send host "[board_info $dest gdb_run_command]\n" } else { remote_send host "run\n" } # FIXME: The value 300 below should be a parameter. if {[board_info $dest exists testcase_timeout]} { set testcase_timeout [board_info $dest testcase_timeout] } else { set testcase_timeout 300 } remote_expect host $testcase_timeout { -re "Line.*Jump anyway.*.y or n.*" { remote_send host "y\n" exp_continue } -re {Continuing( at |\.| with no signal\.)[^\r\n]*[\r\n]} { exp_continue } -re ".*Start it from the beginning?.*y or n.*" { remote_send host "n\n" remote_expect host 10 { -re ".*$gdb_prompt $" { remote_send host "signal 0\n" remote_expect host 10 { -re {signal 0[\r\n]+} { exp_continue } -re {Continuing(\.| with no signal\.)[\r\n]} {} } } } exp_continue } -re {(run[\r\n]*|)Starting program: [^\r\n]*[\r\n]} { exp_continue } -re "$gdb_prompt (signal 0|continue)\[\r\n\]+Continuing(\\.| with no signal\\.)\[\r\n\]" { exp_continue } -re "(.*)Breakpoint.*exit.*=0.*$gdb_prompt $" { append output $expect_out(1,string) set result [check_for_board_status output] gdb_comm_leave if { $result > 0 } { return [list "fail" $output] } return [list "pass" $output] } -re "(.*)Breakpoint.*exit.*=\[1-9\]\[0-9\]*.*$gdb_prompt $" { append output $expect_out(1,string) set result [check_for_board_status output] gdb_comm_leave if { $result == 0 } { return [list "pass" $output] } if {[board_info $dest exists exit_statuses_bad]} { return [list "pass" $output] } return [list "fail" $output] } -re "(.*)Breakpoint.*exit.*$gdb_prompt $" { append output $expect_out(1,string) set status [check_for_board_status output] gdb_comm_leave if { $status > 0 } { return [list "fail" $output] } return [list "pass" $output] } -re "(.*)Breakpoint.*abort.*$gdb_prompt $" { append output $expect_out(1,string) check_for_board_status output gdb_comm_leave return [list "fail" $output] } -re "SIGTRAP.*$gdb_prompt $" { return [gdb_comm_reload $dest $prog $args] } -re "(.*)Program (received |terminated ).*$gdb_prompt $" { set output $expect_out(1,string) check_for_board_status output gdb_comm_leave remote_reboot $dest return [list "fail" $output] } -re "(.*)Program exited with code \[0-9\]+.*$gdb_prompt $" { set output $expect_out(1,string) set status [check_for_board_status output] gdb_comm_leave if { $status > 0 } { return [list "fail" $output] } return [list "pass" $output] } default { gdb_comm_leave if {[board_info $dest exists unreliable]} { if { [board_info $dest unreliable] > 0 } { global board_info set name [board_info $dest name] incr board_info($name,unreliable) -1 set result [gdb_comm_reload $dest $prog $args] incr board_info($name,unreliable) return $result } } return [list "fail" ""] } } gdb_comm_leave return [list "fail" ""] } # If we've tried less than 4 times to load PROG, reboot the target, restart GDB # and try again. Otherwise, return "untested". proc gdb_comm_reload { dest prog aargs } { global try_again # how many times have we done this? set n_reloads [board_info $dest n_reloads] if {$n_reloads eq ""} { set n_reloads 0 } # increment it global board_info set name [board_info $dest name] set board_info($dest,n_reloads) [expr {$n_reloads + 1}] # how many times are we allowed to do this? set max [board_info $dest max_reload_reboots] if {$max eq ""} { set max 15 } # if we've been doing this too much, something's very # wrong. just give up, to reduce stress on boards. if {$max == $n_reloads} { perror "Too many reboots. Giving up." } if {$max <= $n_reloads} { return {untested {}} } if { $try_again < 4 } { global GDB remote_reboot $dest remote_close host incr try_again set result [eval remote_load \"$dest\" \"$prog\" $aargs] set try_again 0 return $result } else { set try_again 0 return [list "untested" ""] } } set_board_info protocol "gdb_comm" dejagnu-1.6.3/config/gdb_stub.exp0000644000000000000000000003571313407073625013621 00000000000000# Copyright (C) 1992-2016 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. # This file was written by Michael Snyder . # # Stub remote run command. # proc gdb_stub_init { dest args } { global gdb_prompt global GDB global tool_root_dir if {![info exists GDB]} then { set GDB "[lookfor_file $tool_root_dir gdb/gdb]" if { $GDB eq "" } { set GDB [transform gdb] } } if {[board_info $dest exists gdb_prompt]} { set gdb_prompt [board_info $dest gdb_prompt] } else { set gdb_prompt {\(gdb\)} } return 1 } proc gdb_stub_restart { dest } { global gdb_prompt global GDB gdb_stub_init $dest for { set x 1 } { $x < 4 } {incr x} { remote_close $dest sleep 2 set command "$GDB -nw -nx" if {[host_info exists gdb_opts]} { append command " [host_info gdb_opts]" } set spawn_id [remote_spawn host $command] remote_expect host 30 { -re $gdb_prompt { } } if { $spawn_id >= 0 } { if {[board_info $dest exists baud]} { remote_send host "set remotebaud [board_info $dest baud]\n" remote_expect host 5 { -re $gdb_prompt { } default { warning "Error setting baud rate." return -1 } } } set value [gdb_stub_startup $dest] if { $value > 0 } { break } verbose "got $value from gdb_stub_startup" remote_send host "quit\n" } remote_reboot $dest } if { $x < 4 } { global board_info set name [board_info $dest name] set board_info($name,gdb_is_running) 1 return 1 } else { return 0 } } proc gdb_stub_remote_check { dest } { global gdb_prompt if {[board_info $dest exists gdb_serial]} { set serial [board_info $dest gdb_serial] } elseif {[board_info $dest exists serial]} { set serial [board_info $dest serial] } else { set serial [board_info $dest netport] } remote_send host "target remote $serial\n" remote_expect host 10 { -re "Couldn't establish connection.*$gdb_prompt" { return 0 } -re "Remote debugging.*$gdb_prompt" { verbose "stub is already running" return 1 } -re $gdb_prompt { return 0 } timeout { remote_send host "\003" remote_expect host 10 { -re $gdb_prompt { } } return 0 } default { return 0 } } } proc gdb_stub_startup { dest } { global gdb_prompt global GDB set is_running_stub 0 if {[gdb_stub_remote_check $dest]} { set is_running_stub 1 } if {[board_info $dest exists serial]} { set serial [board_info $dest serial] } else { set serial [board_info $dest netport] } if { ! $is_running_stub } { set command "target [board_info $dest gdb_protocol] $serial\n" remote_send host $command remote_expect host 5 { -re "already.*y or n." { remote_send host "y\n" exp_continue } -re "appears to be alive.*$gdb_prompt" { } -re "Remote target.*connected to.*$gdb_prompt" { } default { return -1 } } } if { $is_running_stub == 0 } { global libdir verbose "building loader" set loader "loader" if {![file exists $loader]} { if {[board_info $dest exists gdb_stub_offset]} { set result [target_compile $libdir/stub-loader.c $loader executable "libs=-Wl,-Ttext,[board_info $dest gdb_stub_offset]"] } else { set result [target_compile $libdir/stub-loader.c $loader executable "ldscript=[board_info $dest gdb_stub_ldscript]"] } verbose "result is $result" if {[isremote host]} { set loader [remote_download host $loader] } } remote_send host "file $loader\n" remote_expect host 20 { -re "A program is being debug.*Kill it.*y or n. $" { remote_send host "y\n" exp_continue } -re "Load new symbol table.*y or n. $" { remote_send host "y\n" exp_continue } -re "Reading symbols from.*done..*$gdb_prompt $" {} -re "$gdb_prompt $" { warning "GDB couldn't find loader" } timeout { warning "(timeout) read symbol file" return -1 } } if {[board_info $dest exists serial]} { set serial [board_info $dest serial] } else { set serial [board_info $dest netport] } remote_send host "target [board_info $dest gdb_protocol] $serial\n" remote_expect host 60 { -re "appears to be alive.*$gdb_prompt" { } -re "Remote target.*connected to.*$gdb_prompt" { } -re $gdb_prompt { warning "Error reconnecting to stub." return -1 } default { warning "Error reconnecting to stub." return -1 } } # We only send the offset if gdb_load_offset is set. Otherwise, we # assume that sending the offset isn't needed. if {[board_info $dest exists gdb_load_offset]} { remote_send host "load $loader [board_info $dest gdb_stub_offset]\n" } else { remote_send host "load $loader\n" } verbose "Loading $loader into $GDB" 2 global verbose set no_run_command 0 # FIXME: The value 1200 below should be a parameter. remote_expect host 1200 { -re "Transfer rate:.*Switching to remote protocol.*Remote debugging" { set no_run_command 1 remote_send host "" sleep 2 remote_send host "" sleep 1 } -re "Loading.*Starting.*at.*$gdb_prompt $" { verbose "Loaded $loader into $GDB" 1 set no_run_command 1 } -re "Loading.*$gdb_prompt $" { verbose "Loaded $loader into $GDB" 1 } -re "$gdb_prompt $" { if $verbose>1 then { warning "GDB couldn't load." } } timeout { if $verbose>1 then { warning "Timed out trying to load $arg." } } } if { ! $no_run_command } { remote_send host "run\n" remote_expect host 60 { -re "A program is being debug.*Kill it.*y or n. $" { remote_send host "y\n" exp_continue } -re "The program being debugged .*y or n. $" { remote_send host "y\n" exp_continue } -re "Starting program:.*loader.*$" { verbose "Starting loader succeeded" } timeout { warning "(timeout) starting the loader" return -1 } default { warning "error starting the loader" } } sleep 2 remote_send host "" sleep 1 remote_send host "" verbose "Sent ^C^C" remote_expect host 30 { -re "Give up .and stop debugging it.*$" { remote_send host "y\n" exp_continue } -re "$gdb_prompt $" { verbose "Running loader succeeded" } timeout { warning "(timeout) interrupting the loader" return -1 } default { warning "error interrupting the loader" } } } remote_send host "quit\n" return [gdb_stub_restart $dest] } return 1 } # # Delete all breakpoints and verify that they were deleted. If anything # goes wrong we just exit. # proc gdb_stub_delete_breakpoints {} { global gdb_prompt remote_send host "delete breakpoints\n" remote_expect host 10 { -re "Delete all breakpoints.*y or n. $" { remote_send host "y\n" exp_continue } -re "$gdb_prompt $" { } timeout { warning "Delete all breakpoints (timeout)" ; return -1} } remote_send host "info breakpoints\n" remote_expect host 10 { -re "No breakpoints or watchpoints..*$gdb_prompt $" {} -re "$gdb_prompt $" { warning "breakpoints not deleted" ; return -1} timeout { warning "info breakpoints (timeout)" ; return -1} } return 0 } proc gdb_stub_go_idle { dest } { gdb_stub_delete_breakpoints } proc gdb_stub_add_breakpoint { function args } { global gdb_prompt remote_send host "break $function\n" remote_expect host 60 { -re "Breakpoint (\[0-9\]+).*$gdb_prompt $" { return $expect_out(1,string) } -re "Function.*not defined.*$gdb_prompt $" { return "undef" } -re "No symbol table.*$gdb_prompt $" { return "undef" } default { return "undef" } } } proc gdb_stub_start { dest } { global gdb_prompt set exit_brnum [gdb_stub_add_breakpoint _exit] if { $exit_brnum eq "undef" || [board_info $dest exists always_break_exit] } { set exit_brnum [gdb_stub_add_breakpoint exit] } set abort_brnum [gdb_stub_add_breakpoint abort] upvar #0 gdb_stub_info I set I($dest,exit_brnum) $exit_brnum set I($dest,abort_brnum) $abort_brnum remote_send host "set \$fp=0\n" remote_expect host 10 { -re $gdb_prompt { } } # This is needed for the SparcLite. Whee. if {[board_info $dest exists gdb,start_symbol]} { set start_comm "jump *[board_info $dest gdb,start_symbol]\n" } else { set start_comm "jump *start\n" } remote_send host "break copyloop\n" remote_expect host 10 { -re "Breakpoint.*$gdb_prompt $" { set start_comm "continue\n" } -re "Function.*not defined.*$gdb_prompt $" { } default { } } remote_send host $start_comm remote_expect host 10 { -re "y or n. $" { remote_send host "y\n" exp_continue } -re "Breakpoint.*in copyloop.*$gdb_prompt $" { remote_send host "jump relocd\n" exp_continue } -re {Continuing at.*[\r\n]} { } default { return { "fail" "" } } } return { "pass" "" } } proc gdb_stub_spawn { dest prog args } { for { set x 0 } { $x < 3 } { incr x } { if { [remote_ld $dest $prog] != 1 } { return [list "fail" "remote_ld failed"] } set result [gdb_stub_start $dest] if { [lindex $result 0] ne "pass" } { remote_reboot target } else { return 666; # does anyone use this value? } } return -1 } proc gdb_stub_wait { dest timeout } { global gdb_prompt upvar #0 gdb_stub_info I set exit_brnum $I($dest,exit_brnum) set abort_brnum $I($dest,abort_brnum) remote_expect host $timeout { -re "Breakpoint.*exit.*=0.*$gdb_prompt $" { gdb_stub_go_idle $dest return [list 0 ""] } -re "Breakpoint.*exit.*=\[1-9\]\[0-9\]*.*$gdb_prompt $" { gdb_stub_go_idle $dest return [list 0 ""] } -re "Breakpoint.*exit.*$gdb_prompt $" { gdb_stub_go_idle $dest return [list 0 ""] } -re "Breakpoint.*abort.*$gdb_prompt $" { gdb_stub_go_idle $dest return [list 1 ""] } -re " EXIT code 0.*$gdb_prompt $" { gdb_stub_go_idle $dest return [list 0 ""] } -re " EXIT code \[1-9]\[0-9]*.*$gdb_prompt $" { gdb_stub_go_idle $dest return [list 0 ""] } -re " EXIT code 4242.*$gdb_prompt $" { gdb_stub_go_idle $dest return [list 1 ""] } -re "Program received.*$gdb_prompt $" { gdb_stub_go_idle $dest return [list 1 ""] } -re "Program exited.*$gdb_prompt $" { gdb_stub_go_idle $dest return [list 1 ""] } -re "Breakpoint $exit_brnum.*$gdb_prompt $" { gdb_stub_go_idle $dest return [list 0 ""] } -re "Breakpoint $abort_brnum.*$gdb_prompt $" { gdb_stub_go_idle $dest return [list 1 ""] } default { remote_close $dest remote_reboot $dest return [list -1 ""] } } return [list -1 ""] } proc gdb_stub_load { dest prog args } { global gdb_prompt set argnames { "command-line arguments" "input file" "output file" } for { set x 0 } { $x < [llength $args] } { incr x } { if { [lindex $args $x] ne "" } { return [list "unsupported" "no support for [lindex $argnames $x] on this target"] } } set result [remote_spawn $dest $prog] if { $result < 0 } { return [list "fail" "remote_spawn failed"] } # FIXME: The value 120 should be a parameter. set result [remote_wait $dest 120] set status [lindex $result 0] set output [lindex $result 1] if { $status == 0 } { return [list "pass" $output] } elseif { $status > 0 } { return [list "fail" $output] } else { global gdb_stub_retry if {![info exists gdb_stub_retry]} { set gdb_stub_retry 1 set result [eval gdb_stub_load \{$dest\} \{$prog\} $args] unset gdb_stub_retry return $result } else { return [list "fail" $output] } } } # # gdb_stub_ld -- load PROG into the board # Returns a 0 if there was an error, # 1 if it loaded successfully. # proc gdb_stub_ld { dest prog } { global gdb_prompt global GDB if {![board_info $dest exists gdb_is_running]} { if {![gdb_stub_restart $dest]} { return 0 } } set loadfile [file tail $prog] set loadpath [file dirname $prog] remote_send host "file $prog\n" remote_expect host 30 { -re "A program is being debug.*Kill it.*y or n. $" { remote_send host "y\n" exp_continue } -re "Load new symbol table.*y or n. $" { remote_send host "y\n" exp_continue } -re "Reading symbols from.*done..*$gdb_prompt $" {} -re "$gdb_prompt $" { # Hmmm...is retrying going to help? I kinda doubt it. warning "GDB couldn't read file" return [gdb_stub_retry_ld $dest $prog] } timeout { warning "(timeout) read symbol file" return [gdb_stub_retry_ld $dest $prog] } } # just in case there are old breakpoints lying around. gdb_stub_delete_breakpoints if {[board_info $dest exists gdb_serial]} { set serial [board_info $dest gdb_serial] } elseif {[board_info $dest exists serial]} { set serial [board_info $dest serial] } else { set serial [board_info $dest netport] } remote_send host "target remote $serial\n" remote_expect host 60 { -re "Kill it?.*y or n.*" { remote_send host "y\n" exp_continue } -re "$gdb_prompt $" { verbose "Set remote target to $serial" 2 } timeout { warning "Couldn't set remote target." return 0 } } if {[board_info $dest exists gdb_load_offset]} { set offset "[board_info $dest gdb_load_offset]" } else { set offset "" } remote_send host "load $prog $offset\n" verbose "Loading $prog into $GDB" 2 global verbose remote_expect host 1200 { -re "Loading.*$gdb_prompt $" { verbose "Loaded $prog into $GDB" 1 } -re "$gdb_prompt $" { if $verbose>1 then { warning "GDB couldn't load." } } timeout { if $verbose>1 then { perror "Timed out trying to load $prog." } } } return 1 } # # Retry the ld operation, but only once. # proc gdb_stub_retry_ld { dest prog } { global gdb_stub_retry_ld remote_reboot $dest if {[info exists gdb_stub_retry_ld]} { unset gdb_stub_retry_ld return 0 } else { set gdb_stub_retry_ld 1 } gdb_stub_restart $dest set status [gdb_stub_ld $dest $prog] if {[info exists gdb_stub_retry_ld]} { unset gdb_stub_retry_ld } return $status } proc gdb_stub_close { dest } { global board_info set name [board_info $dest name] if {[info exists board_info($name,gdb_is_running)]} { unset board_info($name,gdb_is_running) } return [remote_close host] } set_board_info protocol "gdb_stub" dejagnu-1.6.3/config/sid.exp0000644000000000000000000000511213407073625012575 00000000000000# Copyright (C) 1992-2016 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. # Routines for loading and running programs on a SID simulator. # Written by Ben Elliston . # See default.exp for explanation of arguments and results. load_generic_config "sim" # Treat sid as a remote board set_board_info use_gdb_stub 1 # The simulator doesn't return exit statuses and we need to indicate this; # the standard GCC wrapper will work with this target. set_board_info needs_status_wrapper 1 # Doesn't pass signals and can't return results. set_board_info gdb,nosignals 1 set_board_info gdb,noresults 1 # Don't expect interrupts to work in gdb testsuite proc set_host_info { entry value } { global target_info board_info verbose "set_host_info $entry $value" 3 set machine host if {[info exists target_info($machine,name)]} { set machine $target_info($machine,name) } set board_info($machine,$entry) $value } set_host_info gdb,nointerrupts 1 # Cannot pass command line arguments set_board_info noargs 1 # Configure TCP/IP connection to sid set_board_info connect telnet set_board_info netport localhost:[expr {3000 + [clock clicks] % 2000}] set_board_info gdb,big_rx_buffers 1 set_board_info gdb_protocol "remote" # ... or "async" or "extended-remote" or "extended-async" # No multilib options needed by default. process_multilib_options "" # We only support newlib on this target. We assume that all multilib # options have been specified before we get here. set_board_info compiler "[find_gcc]" set_board_info cflags "[libgloss_include_flags] [newlib_include_flags]" set_board_info ldflags "[libgloss_link_flags] [newlib_link_flags]" # No linker script needed. set_board_info ldscript "" # Used by a few gdb tests. SID doesn't allow hardware watchpoints. set_board_info gdb,no_hardware_watchpoints 1 # Additional sid options # eg: # # set_board_info sim,options "--mksid" dejagnu-1.6.3/config/sim.exp0000644000000000000000000000761713407073625012622 00000000000000# Copyright (C) 1992-2016 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. # # sim_load -- load the program and execute it # # See default.exp for explanation of arguments and results. # proc sim_spawn { dest cmdline args } { if {![board_info $dest exists sim]} { perror "no simulator defined for [board_info $dest name]" exit 1 } else { set sim [board_info $dest sim] } if {[board_info $dest exists sim,options]} { set simflags [board_info $dest sim,options] } else { set simflags "" } if {![isremote host]} { if { [which $sim] == 0 } { verbose -log "Simulator $sim missing." 3 return -1 } } if {[isremote host]} { # download the program to remote. # we're assuming the program is the first word in the command. # FIXME: "prog < infile" won't work until we download infile. set prog [lindex $cmdline 0] set prog [remote_download host $prog a.out] set cmdline [lreplace $cmdline 0 0 $prog] } return [eval remote_spawn host \{ $sim $simflags $cmdline \} $args] } proc sim_wait { dest timeout } { return [remote_wait host $timeout] } proc sim_load { dest prog args } { set inpfile "" if { [llength $args] > 1 } { if { [lindex $args 1] ne "" } { set inpfile "[lindex $args 1]" } } if {![file exists $prog]} then { perror "sim.exp: $prog to be downloaded does not exist." verbose -log "$prog to be downloaded does not exist." 3 return [list "untested" ""] } if {[board_info $dest exists sim_time_limit]} { set sim_time_limit [board_info $dest sim_time_limit] } else { set sim_time_limit 240 } set output "" if { [board_info target sim,protocol] eq "sid" } { set cmd "-e \"set cpu-loader file [list $prog]\"" } elseif { [board_info target sim,protocol] eq "rawsid" } { set cmd "--load=$prog" } else { set cmd $prog } # Run the program with a limited amount of real time. While # this isn't as nice as limiting the amount of CPU time, it # will have to do. if { $inpfile ne "" } { set res [remote_spawn target "$cmd < $inpfile" "readonly"] } else { set res [remote_spawn target $cmd] } if { $res <= 0 } { return [list "fail" "remote_spawn failed"] } set state [remote_wait target $sim_time_limit] set status [lindex $state 0] set output [lindex $state 1] verbose "Output is $output" set status2 [check_for_board_status output] if { $status2 >= 0 } { set status $status2 } verbose "Return status was: $status" 2 if { $status == 0 } { set result "pass" } else { set result "fail" } return [list $result $output] } proc sim_download { dest file args } { return [remote_download host $file $args] } proc sim_upload { dest srcfile args } { return [remote_upload host $srcfile $args] } proc sim_exec { dest srcfile args } { perror "Remote execution for simulators not implemented." verbose -log "Remote execution for simulators not implemented." return -1 } proc sim_file { board args } { return [eval [list remote_file host] $args] } set_board_info protocol "sim" # By default, assume the simulator is slow. This causes some tests # to either be simplified or skipped completely. set_board_info slow_simulator 1 dejagnu-1.6.3/config/unix.exp0000644000000000000000000001121413676762721013013 00000000000000# Copyright (C) 1992-2016 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. # This file was written by Rob Savoye . if {![info exists board]} { error "must set $board before loading unix.exp" } # For rcp_download, rsh_exec. load_lib remote.exp # # unix_load -- load the program and execute it # # See default.exp for explanation of arguments and results. # proc unix_load { dest prog args } { global ld_library_path global test_timeout set output "" set orig_ld_library_path "" if {![info exists test_timeout]} { set test_timeout 300 } if { [llength $args] > 0 } { set parg [lindex $args 0] } else { set parg "" } if { [llength $args] > 1 } { set inp [lindex $args 1] } else { set inp "" } if {![file exists $prog]} then { # We call both here because this should never happen. perror "$prog does not exist in unix_load." verbose -log "$prog does not exist." 3 return "untested" } verbose "loading to $dest" 2 if {![isremote $dest]} { if { $inp ne "" } { set command "$prog $parg < $inp" } else { set command "$prog $parg" } if {![info exists ld_library_path]} { set ld_library_path "" } set orig_ld_library_path "[getenv LD_LIBRARY_PATH]" setenv LD_LIBRARY_PATH $ld_library_path:$orig_ld_library_path setenv SHLIB_PATH $ld_library_path:$orig_ld_library_path verbose -log "Setting LD_LIBRARY_PATH to $ld_library_path:$orig_ld_library_path" 2 verbose -log "Execution timeout is: $test_timeout" 2 # Prepend shell name (e.g., qemu emulator) to the command. if {[board_info $dest exists exec_shell]} { set command "[board_info $dest exec_shell] $command" } set id [remote_spawn $dest $command "readonly"] if { $id < 0 } { set output "remote_spawn failed" set status -1 } else { set status [remote_wait $dest $test_timeout] set output [lindex $status 1] set status [lindex $status 0] } # Unset them so we don't potentially get hosed when we try to run a # non-testcase executable. (Setting LD_LIBRARY_PATH is the wrong # fix in the first place; this just tries to minimize the resulting # crap.) if {[info exists ld_library_path]} { setenv LD_LIBRARY_PATH $orig_ld_library_path setenv SHLIB_PATH $orig_ld_library_path } } else { set remotefile [file tail $prog] set remotefile [remote_download $dest $prog $remotefile] if { $remotefile eq "" } { verbose -log "Download of $prog to [board_info $dest name] failed." 3 return [list "unresolved" ""] } if {[board_info $dest exists remote_link]} { if {[[board_info $dest remote_link] $remotefile]} { verbose -log "Couldn't do remote link" remote_exec $dest "\\rm -f $remotefile" return [list "unresolved" ""] } verbose "$prog linked ok" 3 } else { # rcp's to lynx seem not to get marked executable set status [remote_exec $dest "chmod +x $remotefile"] if { [lindex $status 0] != 0 } { remote_file $dest delete $remotefile.o $remotefile verbose -log "chmod +x of $prog on $dest failed." 3 return [list "unresolved" ""] } } # Prepend shell name (e.g., qemu emulator) to the command. if {[board_info $dest exists exec_shell]} { set remotecmd "[board_info $dest exec_shell] $remotefile" } else { set remotecmd "$remotefile" } set status [remote_exec $dest $remotefile $parg $inp] remote_file $dest delete $remotefile.o $remotefile if { [lindex $status 0] < 0 } { verbose -log "Couldn't execute $prog, [lindex $status 1]" 3 return [list "unresolved" ""] } set output [lindex $status 1] set status [lindex $status 0] } setenv LD_LIBRARY_PATH $orig_ld_library_path setenv SHLIB_PATH $orig_ld_library_path verbose "Executed $prog, status $status" 2 if {$output ne ""} { verbose -- $output 2 } if { $status == 0 } { set result "pass" } else { set result "fail" } return [list $result $output] } set_board_info remotedir "/tmp/runtest.[pid]" set_board_info protocol "unix" dejagnu-1.6.3/config/vxworks.exp0000644000000000000000000003023513407073625013545 00000000000000# Copyright (C) 1992-2016 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. # This file was originally written by Rob Savoye # and modified by Bob Manson . # # Try to boot the machine into the requested OS. # proc ${board}_init { dest } { # This is not the right way to determine the required OS... global target_os set shell_prompt [board_info $dest shell_prompt] set do_reboot 0 set desired_kernel [board_info $dest "kernel,$target_os"] if { $desired_kernel eq "" } { vxworks_final_init $dest # Nothing to see here, nothing to do. Move along. return } remote_raw_open $dest raw remote_send $dest "\n" remote_expect $dest 5 { -re $shell_prompt { set do_reboot 1 } -re "Press any key to stop auto-boot" { remote_send $dest "\n" exp_continue } -re "VxWorks Boot" { set boot_mon 0 set boot_mon_prompt "VxWorks Boot" } -re {[0-9][\r\n]+ *[0-9][\r\n]} { remote_send $dest "\n" exp_continue } timeout { set do_reboot 1 } } if { $do_reboot } { remote_close $dest remote_reboot $dest return } remote_binary $dest remote_send $dest "\n\n" remote_expect $dest 3 { timeout {} -re ".+" { exp_continue } } remote_send $dest "p\n" remote_expect $dest 20 { -re {file name[ \t]+: ([^ \r\n]+)[ \r\n]+} { set curr_file $expect_out(1,string) exp_continue } -re $boot_mon_prompt { } } if {![info exists curr_file]} { remote_close $dest remote_reboot $dest return } if { $curr_file ne $desired_kernel } { verbose "$curr_file != '$desired_kernel'" # Oh boy. remote_send $dest "c\n" remote_expect $dest 20 { -re {file name[ \t]+:.*$} { remote_send $dest "$desired_kernel\n" exp_continue } -re {[a-z() \t]+:.*$} { remote_send $dest "\n" exp_continue } -re $boot_mon_prompt {} } } remote_send $dest "@\n" remote_expect $dest 30 { -re "(^|\[\r\n\])$shell_prompt" {} -re ".+" { exp_continue } } vxworks_final_init $dest remote_close $dest } proc vxworks_final_init { dest } { if {[board_info $dest exists preload_obj]} { if { [target_compile [board_info $dest preload_obj] foo.out object [board_info $dest preload_obj_flags]] eq "" } { vxworks_ld $dest foo.out } remote_file build delete foo.out } } # # Execute the command PROGRAM on VxWorks. # proc vxworks_exec { dest program pargs inp outp } { global decimal hex set shell_id [vxworks_open $dest] if { $shell_id < 0 } { return [list -1 "open failure"] } if { $inp ne "" } { set inp [remote_download $dest $inp] set suffix " < $inp" } else { set suffix "" } set shell_prompt [board_info $dest shell_prompt] remote_send $dest "$program $pargs$suffix\n" # FIXME: The value 300 below should probably be a parameter passed in. remote_expect $dest 300 { -re {\[VxWorks Boot\]:} { remote_send $dest "@\n" sleep 20 exp_continue } -re "(.*)value = (-*$decimal) = $hex\[^\r\n\]*\[\r\n\]+$shell_prompt" { set result [list $expect_out(2,string) $expect_out(1,string)] } -re "undefined symbol: .*$shell_prompt" { set result [list 1 "unknown command"] } -re "syntax error.*$shell_prompt" { set result [list -1 "syntax error in command"] } default { set result [list -1 "unable to execute command"] } } if { $suffix ne "" } { remote_file $dest delete $inp } return $result } proc vxworks_download { dest localfile remotefile } { if {[board_info $dest exists vxworks_homedir]} { set rfile "[board_info $dest vxworks_homedir]/$remotefile" remote_download build $localfile $rfile return $rfile } return [remote_raw_download $dest $localfile $remotefile] } proc vxworks_file { dest op args } { set file [lindex $args 0] if {[board_info $dest exists vxworks_homedir]} { set dir "[board_info $dest vxworks_homedir]" switch -- $op { exists { set file "$dir/[file tail $file]" return [file exists $file] } delete { foreach x $args { set x "$dir/[file tail $x]" if { [file exists $x] && [file isfile $x] } { file delete -force -- $x } } return {} } } } return [eval remote_raw_file \"$dest\" \"$op\" $args] } proc vxworks_send { dest string } { # Convert LFs to CRs, 'cause that is what VxWorks wants to see. regsub -all "\n" $string "\r" string verbose "Sending '$string' to $dest" 2 return [remote_raw_send $dest $string] } proc vxworks_open { dest args } { if {[board_info $dest exists fileid]} { return [board_info $dest fileid] } set shell_prompt [board_info $dest shell_prompt] set shell_id [remote_raw_open $dest] if { $shell_id eq "" || $shell_id < 0 } { return -1 } if {[board_info $dest exists logname]} { set logname [board_info $dest logname] if {[board_info $dest exists password]} { remote_send $dest "iam \"$logname\",\"[board_info $dest passwd]\"\r" } else { remote_send $dest "iam \"$logname\"\r" } remote_expect $dest 30 { "iam*value = 0 = 0x0*$shell_prompt" { verbose "Set default user." 2 } timeout { perror "Couldn't set default user." return -1 } } } set dir "" if {[board_info $dest exists ftp_directory]} { set dir [board_info $dest ftp_directory] } if {[board_info $dest exists vxworks_homedir]} { set dir [board_info $dest vxworks_homedir] } if { $dir ne "" } { set status [remote_exec $dest "cd" "\"$dir\""] if {[lindex $status 0]} { perror "Error in cd to $dir--[lindex $status 1]" return 1 } } return $shell_id } # # Load a file into vxworks # # The result is: # 0 - success # 1 - failed (eg: link failed so testcase should fail) # -1 - unresolved (eg: timeout), may be fixed by rebooting # proc vxworks_ld { dest prog } { global decimal hex global board_info if { $prog eq "" } { return 1 } set shell_id [remote_open $dest] if { $shell_id < 0 } { return -1 } set prog [remote_download $dest $prog] set shell_prompt [board_info $dest shell_prompt] # We always want to exit the program via the code at the end. # If the load fails we want `expect_out' stored in the log and this # saves duplicating that code. for { set x 0 } { $x < 3 } { incr x } { remote_send $dest "\n" remote_expect $dest 30 { -re ".*$shell_prompt $" { set x 20 } -re {\[VxWorks Boot\]:} { remote_send $dest "@\n" sleep 20 exp_continue } timeout { return -1 } } } set tries 0 set maxtries 3 set result -7 ;# -7 is a local value meaning "not done" while { $result == -7 && $tries < $maxtries } { verbose "Loading $prog into vxworks." remote_send $dest "ld < $prog\n" incr tries remote_expect $dest 300 { -re "USER.*command not understood" { perror "Need to set the user and password." set result 1 } -re "Stale NFS file handle.*$shell_prompt $" { # Need to retry. } -re "undefined symbol:.*$shell_prompt $" { # This is an error in the testcase, don't call perror. warning "Undefined symbol, $prog not loaded." set result 1 } -re "memPartAlloc: block too.*$shell_prompt $" { perror "Not enough memory to load $prog." set result -1 } -re "can't open input.*$shell_prompt $" { perror "Can't access $prog." set result 1 } -re "value = (-*$decimal) = $hex.*$shell_prompt $" { verbose "Loaded $prog into vxworks." set board_info([board_info $dest name],vx_module) $expect_out(1,string) set result 0 } -re "(.*)$shell_prompt $" { warning "Load failed: $expect_out(1,string)" } timeout { warning "Timed out trying load $prog." set result -1 } } } if { $result && [info exists expect_out(buffer)] } { send_log $expect_out(buffer) } remote_file $dest delete $prog return $result } # # Start a thread (process) executing # # The result is: # 0 - success # 1 - failed (eg: testcase aborted) # -1 - unresolved, may be fixed by rebooting # proc vxworks_run { dest function pargs inp outp } { global hex decimal set shell_prompt [board_info $dest shell_prompt] set output "" # There isn't a command to wait for a thread to finish, so we have to keep # polling. Instead, we expect the status wrapper to return an exit # status. set status [remote_exec $dest "sp" "$function $pargs" $inp $outp] set tid [lindex $status 0] # Bad task id, reboot and try again. if { $tid == -1 || $tid == 0 } { return -1 } set result 1 # FIXME: The value 300 below should be a parameter. remote_expect $dest 300 { -re "task $hex - aborted.*$shell_prompt $" { # FIXME: It's not clear we'll ever get here. verbose "$function aborted" set result 1 } -re {[\r\n]syntax error[\r\n]} { verbose "weirdness after task started" set result -1 } -re "(.*)\\*\\*\\* EXIT code ($decimal)\[\r\n\]" { set output $expect_out(1,string) set exit_code $expect_out(2,string) if { ($exit_code + 0) != 0 } { set result 1 } else { set result 0 } } -re "Operation Fault.*fault type:" { set result 1 } -re "Bus Error" { # This is here to try to cope with apparently flaky h/w. # This is potentially an error in the testcase, but we don't # really know, do we? warning "Bus Error." set result 1 set output "Bus Error" remote_reboot $dest } timeout { # Infinite loop? probably. remote_exec $dest "td" $tid set result 1 } } return [list $result $output] } # # Unload the last executable that we loaded, so we can free up its memory. # proc vxworks_unld { dest } { global board_info if {[board_info $dest exists vx_module]} { # Vxworks5.0 does not have the unld command. if { [board_info $dest os] ne "vxworks5.0" } { remote_exec $dest "unld" "[board_info $dest vx_module]" } unset board_info([board_info $dest name],vx_module) } } # # We loop around rebooting the box until either the load and run # "work" or we give up. # proc vxworks_load {dest prog args} { set result "" set output "" if { [llength $args] > 0 } { set pargs "[lindex $args 0]" } else { set pargs "" } if { [llength $args] > 1 } { set inp "[lindex $args 1]" } else { set inp "" } if { [llength $args] > 2 } { set outp "[lindex $args 2]" } else { set outp "" } for { set x 0 } { $x < 3 } { incr x } { set status [vxworks_ld $dest $prog] if { $status >= 0 } { if { $status > 0 } { set result "fail" } else { set out [vxworks_run $dest __wrap_main $pargs $inp $outp] set status [lindex $out 0] set output [lindex $out 1] # Get rid of the carriage returns, because they confuse # callers that try to parse the result. regsub -all "\r" $output "" output if { $status != 0 } { if { $status > 0 } { set result "fail" } } else { set result "pass" } } } if { $result ne "" } { vxworks_unld $dest return [list $result $output] } remote_reboot $dest } return [list "fail" ""] } set_board_info protocol "vxworks" # -lm under vxworks isn't needed. set_board_info mathlib "" set_board_info shell_prompt "->" set_board_info needs_status_wrapper 1 # FTP doesn't work in passive mode to this board. set_board_info ftp_no_passive 1 # Wait 15 seconds after powercycling. set_board_info reboot_delay 15 # We don't have sys/unistd.h. set_board_info wrap_compile_flags "-DNO_UNISTD_H" set_board_info gdb_prompt "\[(\]vxgdb\[)\]" set_board_info is_vxworks 1 set_board_info gdb,nosignals 1 dejagnu-1.6.3/contrib/0000755000000000000000000000000014062534646011557 500000000000000dejagnu-1.6.3/contrib/mysql/0000755000000000000000000000000014062534646012724 500000000000000dejagnu-1.6.3/contrib/mysql/create-db.sql0000644000000000000000000000374213407073625015216 00000000000000-- Copyright (C) 2016 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. /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8 */; /*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; /*!40103 SET TIME_ZONE='+00:00' */; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; -- -- Table structure for table `test` -- DROP TABLE IF EXISTS `test`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `test` ( `testrun` int(9) NOT NULL DEFAULT '12345', `input` varchar(128) NOT NULL, `output` varchar(256) NOT NULL, `result` enum('PASS','FAIL','XPASS','XFAIL','UNTESTED','UNRESOLVED', 'UNSUPPORTED') NOT NULL, `name` varchar(128) NOT NULL, `prmsid` int(11) NOT NULL, KEY `testrun` (`testrun`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `testruns`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `testruns` ( `tool` varchar(72) NOT NULL, `date` datetime NOT NULL, `version` varchar(72) NOT NULL, `branch` varchar(72) NOT NULL, `testrun` int(20) NOT NULL, `arch` varchar(72) NOT NULL `build_machine` varchar(72) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; dejagnu-1.6.3/contrib/mysql/importxml.sh0000644000000000000000000000623113407073625015232 00000000000000#!/bin/bash # importxml.sh -- import a .sum file into MySQL. # # Copyright (C) 2016 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. # This script takes a compressed or uncompressed sum file from a # DejaGnu test run. It then extracts the relevant information about # the build and writes that to the dejagnu.testruns control # table. After that it converts the sum file to XML, and imports it # into an SQL database, in this case MySQL. if test x"$1" = x; then infile="/tmp/testrun.xml" outfile="/tmp/testrun.xml" else infile=$1 outfile=${1//\.sum.*/.xml} fi if test ! -e "$infile"; then echo "ERROR: no input file specified!" exit fi # These are required to access the database user="USER" passwd="PASSWD" # Check the environment for the database access information if test x"${CBUILD_DBUSER}" != x; then user="${CBUILD_DBUSER}" fi if test x"${CBUILD_DBPASSWD}" != x; then passwd="${CBUILD_DBPASSWD}" fi total=$(mysql -u"$user" -p"$passwd" -e "SELECT testrun from testruns ORDER BY testrun DESC LIMIT 1" dejagnu | tail -1) total=$((total + 1)) type=$(file "$infile") build_machine=$(dirname "$infile" | cut -d '-' -f 8) # If compressed, uncompress it count=$(echo "$type" | grep -c "XZ compressed data") if test "$count" -gt 0; then catprog="xzcat" uncomp="xz -d" else count=$(echo "$type" | grep -c "XZ compressed data") if test "$count" -gt 0; then catprog="gzcat" uncomp="gnzip" else catprog="cat" uncomp="" fi fi # extract the build info from the sum file. # This goes in the dejagnu.testruns table tool=$(${catprog} "$infile" | grep "tests ===" | cut -d ' ' -f 2) target=$(${catprog} "$infile" | head -20 | grep "configuration is " | cut -d ' ' -f 4) version=$(${catprog} "$infile" | head -20 | grep "Running /" | cut -d '/' -f 7 | sed -e 's:^[a-z-]*-::' -e 's:_:.:' -e 's:-branch::' | tail -1) date=$(${catprog} "$infile" | head -1 | sed -e 's:Test Run By [a-zA-Z]* on ::') date=$(date -d "${date}" "+%Y-%m-%d %H:%M:%S") echo "Adding to DB: $target, $version, $date, $tool" # Add an entry in the testrun table for this sum file echo "Adding the test run into the testruns control table." mysql -u"$user" -p"$passwd" --local -e "INSERT INTO dejagnu.testruns VALUES('${tool}','${date}','${version}','svn','${total}','${target}','${build_machine}');" dejagnu # Make the temp file copy if test x"${uncomp}" != x; then rm -f tmp.sum ${catprog} "$infile" > tmp.sum fi # convert the sum file to an xml file so it can be imported echo "Converting the sum file to XML for importing into MySQL." bash "$(dirname "$0")/sum2xml.sh" "$infile" # import the the xml file into MySQL. Note that we add the testrun index which is # retreived from the database earlier in this script. echo "Adding the sum file into the testruns control file." mysql -u"$user" -p"$passwd" --local -e "LOAD XML LOCAL INFILE '${outfile}' INTO TABLE dejagnu.test ROWS IDENTIFIED BY '' SET testrun = '${total}';" dejagnu dejagnu-1.6.3/contrib/mysql/make-datafile.sh0000644000000000000000000001324113407073625015662 00000000000000#!/bin/bash # make-datafile.sh -- export data from MySQL testing database. # # Copyright (C) 2016 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. # This script executes a series of SQL calls to our testing database, # and makes a data file for gnuplot. if test $# -eq 0; then echo "ERROR: no testrun numbers specified!" exit fi # These are required to access the database user="USER" passwd="PASSWD" outfile="testrun.data" # Check the environment for the database access information if test x"${CBUILD_DBUSER}" != x; then user="${CBUILD_DBUSER}" fi if test x"${CBUILD_DBPASSWD}" != x; then passwd="${CBUILD_DBPASSWD}" fi # Create the output file rm -f ${outfile} # Add a header to make the file human readable echo "# date tool version arch total PASS FAIL UNSUPPORTED UNTESTED UNRESOLVED XPASS XFAIL" > ${outfile} machines=$(mysql -u"$user" -p"$passwd" --local -e "SELECT DISTINCT(build_machine) FROM dejagnu.testruns" | sed -e 's/build_machine//' | tr '\n' ' ') echo "Build machines are: ${machines}" tools="gcc g++ gfortran libstdc++ objc" echo "Tools are: ${tools}" for testrun in "$@"; do # Get the build info binfo=$(mysql -u"$user" -p"$passwd" --local -e "SELECT tool,arch,date,version,branch,build_machine FROM dejagnu.testruns WHERE testrun=${testrun}" | tail -1) # Get rid of the embedded newlines binfo=$(echo "$binfo" | tr -d '\n') # Split the query result into fields tool=$(echo "$binfo" | cut -d ' ' -f 1) arch=$(echo "$binfo" | cut -d ' ' -f 2) date=$(echo "$binfo" | cut -d ' ' -f 3) version=$(echo "$binfo" | cut -d ' ' -f 5) build_machine=$(echo "$binfo" | cut -d ' ' -f 7) # Get the test counts # total=`mysql -u"$user" -p${passwd} -e "SELECT count(*) FROM dejagnu.test WHERE result!=''" | tail -1` passes=$(mysql -u"$user" -p"$passwd" --local -e "SELECT count(*) FROM dejagnu.test WHERE testrun=${testrun} AND result='PASS'" | tail -1) fails=$(mysql -u"$user" -p"$passwd" --local -e "SELECT count(*) FROM dejagnu.test WHERE testrun=${testrun} AND result='FAIL'" | tail -1) xpasses=$(mysql -u"$user" -p"$passwd" --local -e "SELECT count(*) FROM dejagnu.test WHERE testrun=${testrun} AND result='XPASS'" | tail -1) xfails=$(mysql -u"$user" -p"$passwd" --local -e "SELECT count(*) FROM dejagnu.test WHERE testrun=${testrun} AND result='XFAIL'" | tail -1) untested=$(mysql -u"$user" -p"$passwd" --local -e "SELECT count(*) FROM dejagnu.test WHERE testrun=${testrun} AND result='UNTESTED'" | tail -1) unsupported=$(mysql -u"$user" -p"$passwd" --local -e "SELECT count(*) FROM dejagnu.test WHERE testrun=${testrun} AND result='UNSUPPORTED'" | tail -1) unresolved=$(mysql -u"$user" -p"$passwd" --local -e "SELECT count(*) FROM dejagnu.test WHERE testrun=${testrun} AND result='UNRESOLVED'" | tail -1) # total=$(mysql -u"$user" -p"$passwd" -e "SELECT count(*) FROM dejagnu.test WHERE testrun=${testrun} AND result!=''" | tail -1) # passes=$(mysql -u"$user" -p"$passwd" --local -e "SELECT count(*) FROM dejagnu.test WHERE testrun=${testrun} AND result='PASS'" | tail -1) # fails=$(mysql -u"$user" -p"$passwd" --local -e "SELECT count(*) FROM dejagnu.test WHERE testrun=${testrun} AND result='FAIL'" | tail -1) # xpasses=$(mysql -u"$user" -p"$passwd" --local -e "SELECT count(*) FROM dejagnu.test WHERE testrun=${testrun} AND result='XPASS'" | tail -1) # xfails=$(mysql -u"$user" -p"$passwd" --local -e "SELECT count(*) FROM dejagnu.test WHERE testrun=${testrun} AND result='XFAIL'" | tail -1) # untested=$(mysql -u"$user" -p"$passwd" --local -e "SELECT count(*) FROM dejagnu.test WHERE testrun=${testrun} AND result='UNTESTED'" | tail -1) # unsupported=$(mysql -u"$user" -p"$passwd" --local -e "SELECT count(*) FROM dejagnu.test WHERE testrun=${testrun} AND result='UNSUPPORTED'" | tail -1) # unresolved=$(mysql -u"$user" -p"$passwd" --local -e "SELECT count(*) FROM dejagnu.test WHERE testrun=${testrun} AND result='UNRESOLVED'" | tail -1) # Write the data line all_passes=$((passes+ xfails)) all_failures=$((fails + xpasses + untested + unresolved + unsupported)) all_tests=$((all_passes + all_failures)) echo "${date} ${tool} ${version} ${arch} ${all_tests} ${passes} ${fails} ${xpasses} ${xfails} ${untested} ${unresolved} ${unsupported} ${build_machine}" >> ${outfile} done # Extract the list of architectures supported for these results arches=$(grep -v '#' testrun.data | cut -d ' ' -f 13 | sort | uniq | tr '\n' ' ') echo "Architectures for this set of results: ${arches}" # Make a separate data file for each architecture so gnuplot can keep them organized for i in ${arches}; do if test "$i" = '.'; then continue fi # filter out bogus test results to avoid weird spikes in the data if test "$passes" -eq 0 -a "$fails" -eq 0; then continue fi rm -f "$i".data grep "$i" testrun.data | sort -V -k 3 | uniq -u > "$i".data done rm testrun.data files=$(find . -maxdepth 1 -name '*.data' | tr '\n' ' ') # Get all the versions in the files, we'll pad rows so all the rows match versions=$(cut -d ' ' -f 3 "$files" | sort -V | uniq | tr '\n' ' ') for i in ${files}; do for j in ${versions}; do cnt=$(grep -c "$j" "$i") if test "$cnt" -eq 0; then echo "Adding $j to $i" machine=$(echo "$i" | cut -d '.' -f 1) echo "${date} ${tool} $j ${arch} 0 0 0 0 0 0 0 0 $machine" >> "$i" fi done done # Re-sort based on the versions we just added as padding so the rows line up for j in ${files}; do mv "$j" tmp.data sort -V -k 3 < tmp.data > "$j" rm tmp.data done dejagnu-1.6.3/contrib/mysql/plot.sh0000644000000000000000000000715613407073625014164 00000000000000#!/bin/bash # plot.sh # # Copyright (C) 2016 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. # This script executes a series of SQL calls to our testing database, # and makes a data file for gnuplot. if test "$#" -eq 0; then echo "Need to supply a graph name!" name="GCC" else name=$1 fi # These are required to access the database user="USER" passwd="PASSWD" outfile="testrun.data" # Check the environment for the database access information if test x"${CBUILD_DBUSER}" != x; then user="${CBUILD_DBUSER}" fi if test x"${CBUILD_DBPASSWD}" != x; then passwd="${CBUILD_DBPASSWD}" fi # setup an array of colors, since the number of data files varies declare -a colors=('green' 'red' 'cyan' 'blue' 'purple' 'brown' 'coral' 'yellow' 'black') type="with lines" type= machines=$(mysql -u"$user" -p"$passwd" --local -e "SELECT DISTINCT(build_machine) FROM dejagnu.testruns" | sed -e 's/build_machine//' | sed -e 's:\.::' | tr '\n' ' ') echo "Build machines are: ${machines}" tools=$(mysql -u"$user" -p"$passwd" --local -e "SELECT DISTINCT(tool) FROM dejagnu.testruns" | sed -e 's/tool//' | tr '\n' ' ') # Only graph if there is a data file #tools="`ls *.data | cut -d '.' -f 1`" echo "Tools are: ${tools}" datafiles="${machines}" if test "$#" -gt 1; then case $2 in m*) datafiles="echo ${machines}" echo "Separating graphs by build machine name" ;; t*) datafiles="${tools}" echo "Separating graphs by tool name" ;; *) datafiles="${machines}" ;; esac fi outfile="gnuplot.cmd" cindex=0 for j in ${datafiles}; do # for now we don't want aarch64 results in the chart as they distort the data # heavily. if test "$(echo "$j" | grep -c aarch64)" -gt 0; then continue fi if test -f "$j".data -a -s "$j".data; then if test ${cindex} -eq 0; then echo "Creating gnuplot comand file: ${outfile}" cat <${outfile} set boxwidth 0.9 relative set style data histograms set style histogram cluster set style fill solid 1.0 border lt -1 set autoscale x set autoscale y #set yrange [97:100] set title "Precentage PASSes" set ylabel "Precent PASS" set format y "%g%%" #set xlabel "Architecture" # Rotate the X axis labels 90 degrees, so they all fit set xtics border in scale 1,0.5 nomirror rotate by -90 offset character 0, 0, 0 # Out the key in out of the way set key right top set term png size 1900,1024 set output "testrun.png" set xlabel "${name} Versions" set grid ytics lt 0 lw 1 lc rgb "#bbbbbb" #set grid xtics lt 0 lw 1 lc rgb "#bbbbbb" EOF # echo -n "plot \"$j.data\" using (((\$6+\$9)/\$5)/100):xtic(3) title \"$j\" lt rgb \"${colors[$cindex]}\" ${type}" >> ${outfile} echo -n "plot \"$j.data\" using ((\$6/\$5) * 100):xtic(3) title \"$j\" lt rgb \"${colors[$cindex]}\" ${type}" >> ${outfile} # cindex=`expr $cindex + 1` # echo -n ", \"\" using (((\$7+\$8+\$10+\$11+\$12)/\$5) * 100):xtic(3) title \"FAILS\" lt rgb \"${colors[$cindex]}\" ${type}" >> ${outfile} else # echo -n ", \"$j.data\" using ((\$6+\$9/\$5)/100):xtic(3) title \"$j\" lt rgb \"${colors[$cindex]}\" ${type}" >> ${outfile} echo -n ", \"$j.data\" using ((\$6/\$5) * 100):xtic(3) title \"$j\" lt rgb \"${colors[$cindex]}\" ${type}" >> ${outfile} fi cindex=$((cindex + 1)) fi done #for j in ${datafiles}; do # if test -f $j.data -a -s $j.data; then cat <>${outfile} set term x11 persist replot EOF # fi #done dejagnu-1.6.3/contrib/mysql/README0000644000000000000000000000232513407073625013523 00000000000000This is a series of scripts to enable one to import into MySQL the output of a test run, and then graph the data. These scripts will likely require modification for different setups, which is why they're in 'contrib' instead of DejaGnu. sum2xml.sh ---------- This script takes a standard DejaGnu .sum file, and converts it to the XML format. Ideally the --xml option to runtest should be used, but this is useful for importing historical data. create-db.sql ------------- This is an SQL input file to create the tables used for this database. This assumes the 'dejagnu' database has been created, but is empty. importxml.sh ------------ This script imports the XML file into MySQL and populates the tables with data. make-datafile.sh ---------------- This script does an SQL query in the 'dejagnu' database, and produces the data files that get used for graphing. This is oriented towards GNU toolchain testing, and is probably the main this any other user would need to modify for their application. Currently the created data files are one for each architecture. plot.sh ------- This script reads the data files produced by make-datafile.sh, and produces a command file for gnuplot, which then makes the chart. dejagnu-1.6.3/contrib/mysql/sum2xml.sh0000644000000000000000000000511713407073625014610 00000000000000#!/bin/bash # sum2xml.sh -- convert a .sum file into XML. # # Copyright (C) 2016 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. if test x"$1" = x; then outfile="/tmp/testrun.xml" infile="/tmp/testrun.sum" else outfile=${1//\.sum.*/.xml} infile=$1 fi # Where to put the output file if test x"$2" = x; then outfile="$outfile" else outfile="/tmp/$outfile" fi if test ! -e "$infile"; then echo "ERROR: no input file specified!" exit fi # If compressed, uncompress it type=$(file "$infile") count=$(echo "$type" | grep -c "XZ compressed data") if test "$count" -gt 0; then decomp="xz -d" comp="xz" else count=$(echo "$type" | grep -c "XZ compressed data") if test "$count" -gt 0; then decomp="gzip" comp="gunzip" fi fi # cat < "$outfile" ]> EOF # Write the opening tag for the test results echo "" >> "$outfile" ${decomp} "$infile" infile=$(echo "$infile" | sed -e 's:\.xz::' -e 's:\.gz::') while read -r line do # ignore blank lines if test x"${line}" = x; then continue fi # # ignore the test case name # if test `echo ${line} | grep -c Running` -gt 0; then # continue # fi # ignore the summary, we get this via SQL later if test "$(echo "$line" | grep -c Summary)" -gt 0; then break fi valid=$(echo "$line" | grep -E -c 'PASS|FAIL|UNTESTED|UNSUPPORTED|UNRESOLVED') if test "$valid" -eq 0; then continue fi echo -n "." { echo ""; echo " "; echo " "; } >> "$outfile" result=${line/: *//} echo " ${result}" >> "$outfile" name=${line/^[A-Z]*: /} { echo " ${name}"; echo " "; echo ""; } >> "$outfile" done < "$infile" # Write the closing tag for the test results echo "" >> "$outfile" # compress the file again ${comp} "$infile" dejagnu-1.6.3/contrib/sum2junit.sh0000755000000000000000000000526713407073625014005 00000000000000#!/bin/bash # sum2junit.sh -- convert a .sum file into Junit-compatible XML. # # Copyright (C) 2016 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. if test x"$1" = x; then outfile="/tmp/testrun.xml" infile="/tmp/testrun.sum" else outfile=${1//\.sum.*/.xml} infile=$1 fi # Where to put the output file if test x"$2" = x; then outfile=${outfile} else outfile="/tmp/${outfile}" fi if test ! -e "$infile"; then echo "ERROR: no input file specified" exit fi tool=$(grep "tests ===" "$infile" | tr -s ' ' | cut -d ' ' -f 2) # Get the counts for tests that didn't work properly skipped=$(grep -E -c '^UNRESOLVED|^UNTESTED|^UNSUPPORTED' "$infile") if test x"${skipped}" = x; then skipped=0 fi # The total of successful results are PASS and XFAIL passes=$(grep -E -c '^PASS|XFAIL' "$infile") if test x"${passes}" = x; then passes=0 fi # The total of failed results are FAIL and XPASS failures=$(grep -E -c '^FAIL|XPASS' "$infile") if test x"${failures}" = x; then failures=0 fi # Calculate the total number of test cases total=$((passes + failures)) total=$((total + skipped)) cat < "$outfile" EOF # Reduce the size of the file to be parsed to improve performance. Junit # ignores sucessful test results, so we only grab the failures and test # case problem results. tmpfile="${infile}.tmp" rm -f "$tmpfile" grep -E 'XPASS|FAIL|UNTESTED|UNSUPPORTED|UNRESOLVED' "$infile" > "$tmpfile" while read -r line do echo -n "." result=$(echo "$line" | cut -d ' ' -f 1 | tr -d ':') name=$(echo "$line" | cut -d ' ' -f 2) message=$(echo "$line" | cut -d ' ' -f 3-50 | tr -d '\"><;:\[\]^\\&?@') echo " " >> "$outfile" case "${result}" in UNSUPPORTED|UNTESTED|UNRESOLVED) if test x"${message}" != x; then echo -n " > "$outfile" else echo -n " > "$outfile" fi ;; XPASS|XFAIL) echo -n " > "$outfile" ;; *) echo -n " > "$outfile" esac echo "\"/>" >> "$outfile" echo " " >> "$outfile" done < "$tmpfile" rm -f "$tmpfile" # Write the closing tag for the test results echo "" >> "$outfile" echo "" >> "$outfile" dejagnu-1.6.3/contrib/dejagnu.py0000644000000000000000000000523413676762721013501 00000000000000#!/usr/bin/python3 # # Copyright (C) 2018, 2019, 2020 Free Software Foundation, Inc. # # This program 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. # # This program 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 this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # class DejaGnu(object): def __init__(self): self.passed = 0 self.failed = 0 self.xfailed = 0 self.xpassed = 0 self.kfailed = 0 self.kpassed = 0 self.untested = 0 self.unresolved = 0 self.verbosity = 0 def verbose_level(self, level=0): self.verbosity = level def verbose(self, msg="", level=0): if self.verbosity > level: print(msg) def fails(self, msg=""): self.failed += 1 print("FAIL: " + msg) def xfails(self, msg=""): self.xfailed += 1 print("XFAIL: " + msg) def untested(self, msg=""): self.untested += 1 print("UNTESTED: " + msg) def xpasses(self, msg=""): self.xpassed += 1 print("XPASS: " + msg) def passes(self, msg=""): self.passed += 1 print("PASS: " + msg) def matches(self, instr, expected, msg="", yes=True): if instr == expected: if yes == True: self.passes(msg) else: self.xpasses(msg) return True else: if yes == True: self.fails(msg) else: self.xfails(msg) # print("\tGot \'" + instr + "\', expected \'" + expected + "\'") return False def totals(self): print("\nTotals") print("-------") if self.passed > 0: print("Total passed: %r " % self.passed) if self.xpassed > 0: print("Total Xpassed: %r " % self.xpassed) if self.failed > 0: print("Total failed: %r " % self.failed) if self.xfailed > 0: print("Total Xfailed: %r " % self.xfailed) if self.untested > 0: print("Total untested: %r " % self.untested) if self.unresolved > 0: print("Total unresolved: %r " % self.unresolved) dejagnu-1.6.3/doc/0000755000000000000000000000000014062534646010664 500000000000000dejagnu-1.6.3/doc/version.texi0000644000000000000000000000014514062530115013147 00000000000000@set UPDATED 28 December 2020 @set UPDATED-MONTH December 2020 @set EDITION 1.6.3 @set VERSION 1.6.3 dejagnu-1.6.3/doc/stamp-vti0000644000000000000000000000014514062534645012452 00000000000000@set UPDATED 28 December 2020 @set UPDATED-MONTH December 2020 @set EDITION 1.6.3 @set VERSION 1.6.3 dejagnu-1.6.3/doc/dejagnu.10000644000000000000000000000712313407073625012303 00000000000000.\" Copyright (C) 2018 Free Software Foundation, Inc. .\" You may distribute this file under the terms of the GNU Free .\" Documentation License. .Dd December 17, 2018 .Os GNU .Dt DEJAGNU 1 URM .Sh NAME .Nm dejagnu .Nd DejaGnu auxiliary command launcher .Sh SYNOPSIS .Nm dejagnu .Ao Ar command Ac .Op Fl -help \*(Ba Ar options... .Nm .Fl -help .Nm .Fl -version .Sh DESCRIPTION The .Nm command finds a script that implements the requested .Ar command , selects from multiple implementations if available according to a fixed internal list, and executes the command. .Sh OPTIONS .Bl -tag -width ".Fl -version" .It Fl -help Print a help message instead of running a command. If no command is given, prints brief usage for .Nm itself. .It Fl V , -version Print a version banner for the launcher itself including the version of DejaGnu. Any command given is ignored. .It Fl v , -verbose Emit additional output describing the operation of the .Nm launcher itself. This option is also passed on to the invoked command. .El .Pp All arguments after the command name are passed to the invoked command. .Sh ENVIRONMENT .Bl -tag -width ".Ev DEJAGNULIBS" .It Ev DEJAGNULIBS If set, the location of DejaGnu's library in the filesystem. The search described in .Sx FILES does not happen if .Ev DEJAGNULIBS is set. .It Ev AWK Full file name for an Awk interpreter that may or may not actually be GNU Awk. If not set, .Ev PATH will be searched for an .Nm awk program. If the Awk interpreter is actually GNU Awk, the .Fl -posix option will be given if an Awk implementation is used. .It Ev GAWK Full file name for GNU Awk. If not set, .Ev PATH will be searched for a .Nm gawk program. .It Ev BASH Full file name for GNU Bash. If not set, .Ev PATH will be searched for a .Nm bash program. Note that Bash itself sets this variable, even when run as .Nm sh , even when running a script. .It Ev EXPECT Full file name for Expect, which is a Tcl interpreter with the Expect extension already loaded. If not set, .Ev PATH will be searched for an .Nm expect program. Note that the DejaGnu core is written in Expect, so this interpreter should always be available. .It Ev TCLSH Full file name for a Tcl interpreter. If not set, .Ev PATH will be searched for a .Nm tclsh program. .El .Pp Note that GNU Awk is considered a superset of Awk and that Expect is considered a superset of Tcl, allowing the former to be used to run scripts written for the latter. This means that, while Awk programs will generally be run with GNU extensions disabled using the .Fl -posix option to GNU Awk, Tcl programs may be run with either .Nm tclsh or .Nm expect and should be written accordingly. .Sh FILES .Bl -tag -width ".Pa $DEJAGNULIBS/commands" .It Pa $DEJAGNULIBS/commands If .Ev DEJAGNULIBS is set, all command scripts are expected to be in this directory. .El Otherwise, the first directory that actually exists in the following list is used, where .Pa @bindir@ represents the directory containing .Nm itself. .Bl -item -offset indent .It .Pa @bindir@/../share/dejagnu/commands .It .Pa @bindir@/../../share/dejagnu/commands .It .Pa /usr/share/dejagnu/commands .It .Pa /usr/local/share/dejagnu/commands .El .\" .Sh EXAMPLES .Sh SEE ALSO The full documentation for DejaGnu is maintained as a Texinfo manual. If the .Nm info program is properly installed at your site, the command .Li info dejagnu should give you access to the complete manual. .Sh AUTHORS .An "Jacob Bachmeyer" .Sh BUGS The command name must precede all other arguments due to limitations of the shell. .\" LocalWords: Dt URM Nm DejaGnu Ao DEJAGNULIBS DejaGnu's Sx awk posix tclsh .\" LocalWords: tcl superset bindir usr Texinfo dejagnu-1.6.3/doc/dejagnu-help.10000644000000000000000000000215413717107010013216 00000000000000.\" Copyright (C) 2018 Free Software Foundation, Inc. .\" You may distribute this file under the terms of the GNU Free .\" Documentation License. .Dd December 19, 2018 .Os GNU .Dt DEJAGNU-HELP 1 URM .Sh NAME .Nm dejagnu\ help .Nd display manual pages for DejaGnu auxiliary commands .Sh SYNOPSIS .Nm dejagnu\ help .Op Ar options... .Ao Ar command Ac .Sh DESCRIPTION The .Nm command displays long-form documentation for DejaGnu auxiliary commands. .Sh OPTIONS .Bl -tag -width ".Fl v , -verbose" .It Fl v , -verbose Emit additional output describing the operation of .Nm itself. .It Fl w , -path This option is simply passed on to .Nm man . .It Fl W This option is simply passed on to .Nm man . .El .Sh FILES The .Nm command checks for man pages in a .Pa doc/ directory next to the .Pa commands/ directory where this script is located. If the page is found there, a full file name is given to .Nm man . Otherwise, only the command name is given and the search described in .Xr man 1 is performed. .Sh SEE ALSO .Xr man 1 .Sh AUTHORS Jacob Bachmeyer .Sh BUGS Currently only supports man pages. .\" LocalWords: Dt URM Nm DejaGnu Ao Xr dejagnu-1.6.3/doc/dejagnu-report-card.10000644000000000000000000001266513666006634014535 00000000000000.\" Copyright (C) 2018 Free Software Foundation, Inc. .\" You may distribute this file under the terms of the GNU Free .\" Documentation License. .Dd December 31, 2018 .Os GNU .Dt DEJAGNU-REPORT-CARD 1 URM .Sh NAME .Nm dejagnu\ report\ card .Nd summarize results from testing multiple tools .Sh SYNOPSIS .Nm dejagnu\ report\ card .Oo Ao Ar option Ac \*(Ba Ao Ar tool Ac \*(Ba Ao Ar file Ac Oc ... .Sh DESCRIPTION The .Nm command displays results from testing multiple tools in a tabular format. The produced table lists, for each tool (and if multiple passes were run, each pass) the number of tests passed, failed, unsupported, unresolved, and untested. Tests that are expected to fail are counted in separate columns from tests expected to pass, but "known" failures and "expected" failures are summarized together. If a test generated warnings or errors, a tag .Ql !W! or .Ql !E! is appended at the end of the relevant line. .Pp Aside from options, the argument list may include tool or file names. The .Nm command prefers to read DejaGnu summary files and will translate names accordingly: .Bl -tag -width ".Pa *.sum" .It Pa *.sum Used as-is. .It Pa *.log Rewritten to .Pa *.sum with the same stem. .It Pa *. The string .Pa sum is appended to select a summary file. This processing is done for convenience when using Readline file name completion in a shell, which will complete to the dot. .It Pa * Taken as a tool name; .Pa .sum is appended. .El .Sh OPTIONS .Bl -tag -width ".Fl v , -verbose" .It Fl v , -verbose Emit additional output describing the operation of .Nm itself. .El .Sh FILES The .Nm command produces its output by reading the summary files produced by DejaGnu and counting "PASS", "FAIL", etc. .Pp If no names are given as arguments, all files matching .Pa *.sum in the current directory are read. .Sh EXAMPLES .Ss A simple example from DejaGnu's own testsuite .Bd -literal $ dejagnu report card \ __________________________________________________ \ / PASS FAIL ?PASS ?FAIL UNSUP UNRES UNTEST \ |-------------------------------------------------- \ launcher | 52 0 0 0 0 0 0 libdejagnu | 5 0 0 0 0 0 0 \ runtest | 135 0 0 0 0 0 0 \ |-------------------------------------------------- \ | 192 0 0 0 0 0 0 \ \\__________________________________________________ .Ed .Pp Three tools were tested, with a total of 192 tests, all expected to pass. In this example, all tests did pass, so all other columns are zero. The .Ql ?PASS and .Ql ?FAIL columns count tests known or expected to fail that either unexpectedly passed or failed as expected. The remaining three columns count the exceptional results for unsupported tests, unresolved tests and stub tests that simply declare themselves untested. .Pp .ne 16v .Ss The same example after tests were added for dejagnu-report-card .Bd -literal $ dejagnu report-card \ __________________________________________________ \ / PASS FAIL ?PASS ?FAIL UNSUP UNRES UNTEST \ |-------------------------------------------------- \ launcher | 52 0 0 0 0 0 0 \ libdejagnu | 5 0 0 0 0 0 0 report-card / awk | 36 0 0 0 0 0 0 report-card / sh | 36 0 0 0 0 0 0 report-card / tcl | 36 0 0 0 0 0 0 \ runtest | 135 0 0 0 0 0 0 \ |-------------------------------------------------- \ awk | 36 0 0 0 0 0 0 \ sh | 36 0 0 0 0 0 0 \ tcl | 36 0 0 0 0 0 0 \ |-------------------------------------------------- \ | 300 0 0 0 0 0 0 \ \\__________________________________________________ .Ed .Pp The .Ql report-card tool has been added, with three passes, one for each implementation. (The shell and Tcl implementations were later dropped to reduce future maintenance burden.) As before, all tests passed as expected. The interesting difference from the previous example is the use of DejaGnu's multipass testing feature and the additional per-pass summary lines added. For this example, only the .Ql report-card tool uses multipass testing, so each pass total is simply the count of tests for .Ql report-card instead of a distinct total. .Pp Also note that the command used to invoke .Nm is slightly different here. The .Xr dejagnu 1 launcher will also accept multiple words joined with dashes into a single argument. This allows individual words in a command name to be separated with either dashes or spaces on the command line interchangeably. .Sh SEE ALSO .Xr dejagnu 1 .Xr runtest 1 .Pp The full documentation for DejaGnu is maintained as a Texinfo manual. If the .Nm info program is properly installed at your site, the command .Li info dejagnu should give you access to the complete manual. .Sh AUTHORS .An Jacob Bachmeyer .\".Sh BUGS .\" LocalWords: Dt dejagnu URM Nm Ao Oo Oc DejaGnu Xr runtest DejaGnu's Bd Ql .\" LocalWords: testsuite UNSUP UNRES UNTEST libdejagnu Readline Ss tcl awk .\" LocalWords: ne multipass dejagnu-1.6.3/doc/runtest.10000644000000000000000000001037313723327141012367 00000000000000.\" Copyright (C) 1993, 1995, 2001, 2002, 2003, 2004, 2005, 2008, .\" 2009, 2012, 2015, 2016, 2017, 2018, 2020 .\" Free Software Foundation, Inc. .\" You may distribute this file under the terms of the GNU Free .\" Documentation License. .TH runtest 1 "2018-12-01" .SH NAME runtest \- DejaGnu test driver .SH SYNOPSIS .B runtest [OPTION]... .SH DESCRIPTION .I DejaGnu is a framework for testing programs using Expect. .B runtest is the driver program for .I DejaGnu. It controls what tests to run and how to run them. .SH OPTIONS .TP .B --all,\ -a Output all test results. By default, only unexpected results are displayed. .TP .BI --build \ TRIPLET The configuration TRIPLET for the build system. .TP .B --debug Turn on .B Expect internal debugging output. The output is logged to a file called \fBdbg.log\fR. .TP .BI --directory \ DIRECTORY Run only tests in the specified DIRECTORY. .TP .BI --global_init \ NAME The NAME to use for the global init file in libdir. The default is \fBsite.exp\fR if this option is not given. .TP .B --help Prints a usage message and then exits. .TP .BI --host \ TRIPLET The configuration TRIPLET for the host system. .TP .BI --host_board \ NAME The host board definition to use. .TP .BI --ignore \ test1.exp\ test2.exp\ ... Do not run the specified tests. .TP .BI --local_init \ NAME The NAME to use for the testsuite local init file in both the current directory and objdir. The default is \fBsite.exp\fR if this option is not given. .TP .B --log_dialog Emit Expect output to standard output. .TP .BI --mail \ \'name1\ name2\ ...\' Electronic mail addresses to receive test results. .TP .BI --objdir \ PATH \fIPATH\fR is a directory containing compiled test code. .TP .BI --outdir \ DIRECTORY The name of a DIRECTORY for test log output. .TP .B --reboot Reboot the target board when \fBruntest\fR initializes (if supported). .TP .BI --srcdir \ PATH \fIPATH\fR is a directory containing test directories. .TP .BI --strace \ N Turns on .B Expect internal tracing to \fIN\fR levels deep. The output is logged to a file called \fBdbg.log\fR. .TP .BI --target \ TRIPLET The configuration TRIPLET for the target. .TP .BI --target_board \ NAME A list of target board NAMEs to run tests on. .TP .BI --tool \ TOOLNAME Specify the tool to be tested. \fITOOLNAME\fR controls the test suite applied, and the associated initialization module. .TP .BI --tool_exec \ PATH Specify the PATH to the executable to test. .TP .BI --tool_opts \ OPTIONS Additional OPTIONS to pass to the tool. .TP .B -v,\ --verbose Turns on more debugging output from test cases and DejaGnu utility code. Use more than once to increase output further. .TP .B -V,\ --version Prints out the versions of DejaGnu, Expect and Tcl. .TP .B -x,\ --xml Generate XML output. The output file is named after the tool with an .xml extension. .TP .B -D[number] Activate the Tcl debugger. \fBnumber\fR can be either 1 or 0. If it is 1, then the Expect shell will break when it starts to run. The interrupt key will cause DejaGnu to drop to the debugger prompt. If it is 0, DejaGnu starts as usual, but Control-C drops to the debugger prompt. .TP 0 Any file name on the command line is assumed to be a subset of the test names to run. Usually these are the names of the test scripts (eg. foo.exp). .PP Makefile-style variables are used to specify tool names and their flags; these and other configuration dependent values are saved in the file \fBsite.exp\fR, created during configuration. .SS "Exit status:" .TP 0 if all tests passed including expected failures and unsupported tests, .TP 1 if any test failed, passed unexpectedly, or was unresolved, .TP 2 if Expect encountered any error in the test scripts. .SH AUTHOR Rob Savoye (rob@welcomehome.org) .SH "REPORTING BUGS" Report bugs to . .SH COPYRIGHT Copyright \(co 2005\-2016, 2018, 2020 Free Software Foundation, Inc. .PP This is free software. You may redistribute copies of it under the terms of the GNU General Public License . There is NO WARRANTY, to the extent permitted by law. .SH "SEE ALSO" The full documentation for .B DejaGnu is maintained as a Texinfo manual. If the .B info program is properly installed at your site, the command .IP .B info dejagnu .PP should give you access to the complete manual. dejagnu-1.6.3/doc/fdl.texi0000644000000000000000000005274213407073625012253 00000000000000@c The GNU Free Documentation License. @center Version 1.3, 3 November 2008 @c This file is intended to be included within another document, @c hence no sectioning command or @node. @display Copyright @copyright{} 2000, 2001, 2002, 2007, 2008 Free Software Foundation, Inc. @uref{https://fsf.org/} Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. @end display @enumerate 0 @item PREAMBLE The purpose of this License is to make a manual, textbook, or other functional and useful document @dfn{free} in the sense of freedom: to assure everyone the effective freedom to copy and redistribute it, with or without modifying it, either commercially or noncommercially. Secondarily, this License preserves for the author and publisher a way to get credit for their work, while not being considered responsible for modifications made by others. This License is a kind of ``copyleft'', which means that derivative works of the document must themselves be free in the same sense. It complements the GNU General Public License, which is a copyleft license designed for free software. We have designed this License in order to use it for manuals for free software, because free software needs free documentation: a free program should come with manuals providing the same freedoms that the software does. But this License is not limited to software manuals; it can be used for any textual work, regardless of subject matter or whether it is published as a printed book. We recommend this License principally for works whose purpose is instruction or reference. @item APPLICABILITY AND DEFINITIONS This License applies to any manual or other work, in any medium, that contains a notice placed by the copyright holder saying it can be distributed under the terms of this License. Such a notice grants a world-wide, royalty-free license, unlimited in duration, to use that work under the conditions stated herein. The ``Document'', below, refers to any such manual or work. Any member of the public is a licensee, and is addressed as ``you''. You accept the license if you copy, modify or distribute the work in a way requiring permission under copyright law. A ``Modified Version'' of the Document means any work containing the Document or a portion of it, either copied verbatim, or with modifications and/or translated into another language. A ``Secondary Section'' is a named appendix or a front-matter section of the Document that deals exclusively with the relationship of the publishers or authors of the Document to the Document's overall subject (or to related matters) and contains nothing that could fall directly within that overall subject. (Thus, if the Document is in part a textbook of mathematics, a Secondary Section may not explain any mathematics.) The relationship could be a matter of historical connection with the subject or with related matters, or of legal, commercial, philosophical, ethical or political position regarding them. The ``Invariant Sections'' are certain Secondary Sections whose titles are designated, as being those of Invariant Sections, in the notice that says that the Document is released under this License. If a section does not fit the above definition of Secondary then it is not allowed to be designated as Invariant. The Document may contain zero Invariant Sections. If the Document does not identify any Invariant Sections then there are none. The ``Cover Texts'' are certain short passages of text that are listed, as Front-Cover Texts or Back-Cover Texts, in the notice that says that the Document is released under this License. A Front-Cover Text may be at most 5 words, and a Back-Cover Text may be at most 25 words. A ``Transparent'' copy of the Document means a machine-readable copy, represented in a format whose specification is available to the general public, that is suitable for revising the document straightforwardly with generic text editors or (for images composed of pixels) generic paint programs or (for drawings) some widely available drawing editor, and that is suitable for input to text formatters or for automatic translation to a variety of formats suitable for input to text formatters. A copy made in an otherwise Transparent file format whose markup, or absence of markup, has been arranged to thwart or discourage subsequent modification by readers is not Transparent. An image format is not Transparent if used for any substantial amount of text. A copy that is not ``Transparent'' is called ``Opaque''. Examples of suitable formats for Transparent copies include plain ASCII without markup, Texinfo input format, La@TeX{} input format, SGML or XML using a publicly available DTD, and standard-conforming simple HTML, PostScript or PDF designed for human modification. Examples of transparent image formats include PNG, XCF and JPG@. Opaque formats include proprietary formats that can be read and edited only by proprietary word processors, SGML or XML for which the DTD and/or processing tools are not generally available, and the machine-generated HTML, PostScript or PDF produced by some word processors for output purposes only. The ``Title Page'' means, for a printed book, the title page itself, plus such following pages as are needed to hold, legibly, the material this License requires to appear in the title page. For works in formats which do not have any title page as such, ``Title Page'' means the text near the most prominent appearance of the work's title, preceding the beginning of the body of the text. The ``publisher'' means any person or entity that distributes copies of the Document to the public. A section ``Entitled XYZ'' means a named subunit of the Document whose title either is precisely XYZ or contains XYZ in parentheses following text that translates XYZ in another language. (Here XYZ stands for a specific section name mentioned below, such as ``Acknowledgements'', ``Dedications'', ``Endorsements'', or ``History''.) To ``Preserve the Title'' of such a section when you modify the Document means that it remains a section ``Entitled XYZ'' according to this definition. The Document may include Warranty Disclaimers next to the notice which states that this License applies to the Document. These Warranty Disclaimers are considered to be included by reference in this License, but only as regards disclaiming warranties: any other implication that these Warranty Disclaimers may have is void and has no effect on the meaning of this License. @item VERBATIM COPYING You may copy and distribute the Document in any medium, either commercially or noncommercially, provided that this License, the copyright notices, and the license notice saying this License applies to the Document are reproduced in all copies, and that you add no other conditions whatsoever to those of this License. You may not use technical measures to obstruct or control the reading or further copying of the copies you make or distribute. However, you may accept compensation in exchange for copies. If you distribute a large enough number of copies you must also follow the conditions in section 3. You may also lend copies, under the same conditions stated above, and you may publicly display copies. @item COPYING IN QUANTITY If you publish printed copies (or copies in media that commonly have printed covers) of the Document, numbering more than 100, and the Document's license notice requires Cover Texts, you must enclose the copies in covers that carry, clearly and legibly, all these Cover Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on the back cover. Both covers must also clearly and legibly identify you as the publisher of these copies. The front cover must present the full title with all words of the title equally prominent and visible. You may add other material on the covers in addition. Copying with changes limited to the covers, as long as they preserve the title of the Document and satisfy these conditions, can be treated as verbatim copying in other respects. If the required texts for either cover are too voluminous to fit legibly, you should put the first ones listed (as many as fit reasonably) on the actual cover, and continue the rest onto adjacent pages. If you publish or distribute Opaque copies of the Document numbering more than 100, you must either include a machine-readable Transparent copy along with each Opaque copy, or state in or with each Opaque copy a computer-network location from which the general network-using public has access to download using public-standard network protocols a complete Transparent copy of the Document, free of added material. If you use the latter option, you must take reasonably prudent steps, when you begin distribution of Opaque copies in quantity, to ensure that this Transparent copy will remain thus accessible at the stated location until at least one year after the last time you distribute an Opaque copy (directly or through your agents or retailers) of that edition to the public. It is requested, but not required, that you contact the authors of the Document well before redistributing any large number of copies, to give them a chance to provide you with an updated version of the Document. @item MODIFICATIONS You may copy and distribute a Modified Version of the Document under the conditions of sections 2 and 3 above, provided that you release the Modified Version under precisely this License, with the Modified Version filling the role of the Document, thus licensing distribution and modification of the Modified Version to whoever possesses a copy of it. In addition, you must do these things in the Modified Version: @enumerate A @item Use in the Title Page (and on the covers, if any) a title distinct from that of the Document, and from those of previous versions (which should, if there were any, be listed in the History section of the Document). You may use the same title as a previous version if the original publisher of that version gives permission. @item List on the Title Page, as authors, one or more persons or entities responsible for authorship of the modifications in the Modified Version, together with at least five of the principal authors of the Document (all of its principal authors, if it has fewer than five), unless they release you from this requirement. @item State on the Title page the name of the publisher of the Modified Version, as the publisher. @item Preserve all the copyright notices of the Document. @item Add an appropriate copyright notice for your modifications adjacent to the other copyright notices. @item Include, immediately after the copyright notices, a license notice giving the public permission to use the Modified Version under the terms of this License, in the form shown in the Addendum below. @item Preserve in that license notice the full lists of Invariant Sections and required Cover Texts given in the Document's license notice. @item Include an unaltered copy of this License. @item Preserve the section Entitled ``History'', Preserve its Title, and add to it an item stating at least the title, year, new authors, and publisher of the Modified Version as given on the Title Page. If there is no section Entitled ``History'' in the Document, create one stating the title, year, authors, and publisher of the Document as given on its Title Page, then add an item describing the Modified Version as stated in the previous sentence. @item Preserve the network location, if any, given in the Document for public access to a Transparent copy of the Document, and likewise the network locations given in the Document for previous versions it was based on. These may be placed in the ``History'' section. You may omit a network location for a work that was published at least four years before the Document itself, or if the original publisher of the version it refers to gives permission. @item For any section Entitled ``Acknowledgements'' or ``Dedications'', Preserve the Title of the section, and preserve in the section all the substance and tone of each of the contributor acknowledgements and/or dedications given therein. @item Preserve all the Invariant Sections of the Document, unaltered in their text and in their titles. Section numbers or the equivalent are not considered part of the section titles. @item Delete any section Entitled ``Endorsements''. Such a section may not be included in the Modified Version. @item Do not retitle any existing section to be Entitled ``Endorsements'' or to conflict in title with any Invariant Section. @item Preserve any Warranty Disclaimers. @end enumerate If the Modified Version includes new front-matter sections or appendices that qualify as Secondary Sections and contain no material copied from the Document, you may at your option designate some or all of these sections as invariant. To do this, add their titles to the list of Invariant Sections in the Modified Version's license notice. These titles must be distinct from any other section titles. You may add a section Entitled ``Endorsements'', provided it contains nothing but endorsements of your Modified Version by various parties---for example, statements of peer review or that the text has been approved by an organization as the authoritative definition of a standard. You may add a passage of up to five words as a Front-Cover Text, and a passage of up to 25 words as a Back-Cover Text, to the end of the list of Cover Texts in the Modified Version. Only one passage of Front-Cover Text and one of Back-Cover Text may be added by (or through arrangements made by) any one entity. If the Document already includes a cover text for the same cover, previously added by you or by arrangement made by the same entity you are acting on behalf of, you may not add another; but you may replace the old one, on explicit permission from the previous publisher that added the old one. The author(s) and publisher(s) of the Document do not by this License give permission to use their names for publicity for or to assert or imply endorsement of any Modified Version. @item COMBINING DOCUMENTS You may combine the Document with other documents released under this License, under the terms defined in section 4 above for modified versions, provided that you include in the combination all of the Invariant Sections of all of the original documents, unmodified, and list them all as Invariant Sections of your combined work in its license notice, and that you preserve all their Warranty Disclaimers. The combined work need only contain one copy of this License, and multiple identical Invariant Sections may be replaced with a single copy. If there are multiple Invariant Sections with the same name but different contents, make the title of each such section unique by adding at the end of it, in parentheses, the name of the original author or publisher of that section if known, or else a unique number. Make the same adjustment to the section titles in the list of Invariant Sections in the license notice of the combined work. In the combination, you must combine any sections Entitled ``History'' in the various original documents, forming one section Entitled ``History''; likewise combine any sections Entitled ``Acknowledgements'', and any sections Entitled ``Dedications''. You must delete all sections Entitled ``Endorsements.'' @item COLLECTIONS OF DOCUMENTS You may make a collection consisting of the Document and other documents released under this License, and replace the individual copies of this License in the various documents with a single copy that is included in the collection, provided that you follow the rules of this License for verbatim copying of each of the documents in all other respects. You may extract a single document from such a collection, and distribute it individually under this License, provided you insert a copy of this License into the extracted document, and follow this License in all other respects regarding verbatim copying of that document. @item AGGREGATION WITH INDEPENDENT WORKS A compilation of the Document or its derivatives with other separate and independent documents or works, in or on a volume of a storage or distribution medium, is called an ``aggregate'' if the copyright resulting from the compilation is not used to limit the legal rights of the compilation's users beyond what the individual works permit. When the Document is included in an aggregate, this License does not apply to the other works in the aggregate which are not themselves derivative works of the Document. If the Cover Text requirement of section 3 is applicable to these copies of the Document, then if the Document is less than one half of the entire aggregate, the Document's Cover Texts may be placed on covers that bracket the Document within the aggregate, or the electronic equivalent of covers if the Document is in electronic form. Otherwise they must appear on printed covers that bracket the whole aggregate. @item TRANSLATION Translation is considered a kind of modification, so you may distribute translations of the Document under the terms of section 4. Replacing Invariant Sections with translations requires special permission from their copyright holders, but you may include translations of some or all Invariant Sections in addition to the original versions of these Invariant Sections. You may include a translation of this License, and all the license notices in the Document, and any Warranty Disclaimers, provided that you also include the original English version of this License and the original versions of those notices and disclaimers. In case of a disagreement between the translation and the original version of this License or a notice or disclaimer, the original version will prevail. If a section in the Document is Entitled ``Acknowledgements'', ``Dedications'', or ``History'', the requirement (section 4) to Preserve its Title (section 1) will typically require changing the actual title. @item TERMINATION You may not copy, modify, sublicense, or distribute the Document except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, or distribute it is void, and will automatically terminate your rights under this License. However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation. Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice. Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, receipt of a copy of some or all of the same material does not give you any rights to use it. @item FUTURE REVISIONS OF THIS LICENSE The Free Software Foundation may publish new, revised versions of the GNU Free Documentation License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. See @uref{https://www.gnu.org/licenses/}. Each version of the License is given a distinguishing version number. If the Document specifies that a particular numbered version of this License ``or any later version'' applies to it, you have the option of following the terms and conditions either of that specified version or of any later version that has been published (not as a draft) by the Free Software Foundation. If the Document does not specify a version number of this License, you may choose any version ever published (not as a draft) by the Free Software Foundation. If the Document specifies that a proxy can decide which future versions of this License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Document. @item RELICENSING ``Massive Multiauthor Collaboration Site'' (or ``MMC Site'') means any World Wide Web server that publishes copyrightable works and also provides prominent facilities for anybody to edit those works. A public wiki that anybody can edit is an example of such a server. A ``Massive Multiauthor Collaboration'' (or ``MMC'') contained in the site means any set of copyrightable works thus published on the MMC site. ``CC-BY-SA'' means the Creative Commons Attribution-Share Alike 3.0 license published by Creative Commons Corporation, a not-for-profit corporation with a principal place of business in San Francisco, California, as well as future copyleft versions of that license published by that same organization. ``Incorporate'' means to publish or republish a Document, in whole or in part, as part of another Document. An MMC is ``eligible for relicensing'' if it is licensed under this License, and if all works that were first published under this License somewhere other than this MMC, and subsequently incorporated in whole or in part into the MMC, (1) had no cover texts or invariant sections, and (2) were thus incorporated prior to November 1, 2008. The operator of an MMC Site may republish an MMC contained in the site under CC-BY-SA on the same site at any time before August 1, 2009, provided the MMC is eligible for relicensing. @end enumerate @c Local Variables: @c ispell-local-pdict: "ispell-dict" @c End: dejagnu-1.6.3/doc/dejagnu.texi0000644000000000000000000062421013772251066013120 00000000000000\input texinfo @c -*- Texinfo -*- @setfilename dejagnu.info @documentencoding us-ascii @settitle DejaGnu @finalout @c man begin INCLUDE @include version.texi @c man end @copying @c man begin COPYRIGHT Copyright @copyright{} 1992-2020 Free Software Foundation, Inc. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3 or any later version published by the Free Software Foundation; with no Invariant Sections, with no Front-Cover Texts, and with no Back-Cover Texts. A copy of the license is included in the section entitled ``GNU Free Documentation License''. @c man end @end copying @dircategory Software development @direntry * DejaGnu: (dejagnu). The GNU testing framework. @end direntry @titlepage @title DejaGnu @ifset VERSION_PACKAGE @subtitle @value{VERSION_PACKAGE} @end ifset @subtitle Version @value{VERSION} @sp 1 @subtitle @value{UPDATED} @author Rob Savoye et al. @author Cygnus Support and the GNU Project @page @vskip 0pt plus 1filll @insertcopying @end titlepage @contents @node Top, Introduction, , (dir) @top DejaGnu @menu * Introduction:: * Running tests:: * Running other DejaGnu commands:: * Customizing DejaGnu:: * Extending DejaGnu:: * Unit testing:: * Built-in Procedures:: * GNU Free Documentation License:: * Concept Index:: * Procedure Index:: * Variable Index:: @detailmenu Introduction * What is DejaGnu?:: * New in this release: Release Notes * Design goals:: * A POSIX conforming test framework: A POSIX Conforming Test Framework. * Installation:: Running tests * Running 'make check': Make Check. * Running runtest: Runtest. * Output files: Output Files. Running other DejaGnu commands * Invoking dejagnu:: Command line options for the launcher itself. * Invoking dejagnu help:: Reading man pages for dejagnu subcommands. * Invoking dejagnu report card:: Summarizing test results from many tools. Customizing DejaGnu * Global configuration file:: * Local configuration file:: * Board configuration file:: * Remote host testing:: * Configuration file values:: Extending DejaGnu * Adding a new testsuite:: * Adding a new tool:: * Adding a new target:: * Adding a new board:: * Board file values:: * Writing a test case:: * Debugging a test case:: * Adding a test case to a testsuite:: * Test case special variables: Test case variables. Unit testing * What is unit testing?:: Unit testing and system testing. * Running unit tests:: * DejaGnu unit test protocol:: DejaGnu native unit testing protocol. * C unit testing API:: * C++ unit testing API:: Reference * Built-in Procedures:: Indices * Concept Index:: * Procedure Index:: * Variable Index:: @end detailmenu @end menu @node Introduction, Running tests, Top, Top @chapter Introduction @menu * What is DejaGnu?:: * New in this release: Release Notes. * Design goals:: * A POSIX compliant test framework: A POSIX Conforming Test Framework. * Installation:: @end menu @node What is DejaGnu?, Release Notes, , Introduction @section What is DejaGnu? DejaGnu is a framework for testing other programs, providing a single front-end for all tests. You can think of it as a library of Tcl procedures to help with writing a test harness. A @emph{test harness} is the infrastructure that is created to test a specific program or tool. Each program can have multiple testsuites, all supported by a single test harness. DejaGnu is written in Expect, which in turn uses Tcl, the Tool command language. There is more information on Tcl at the @uref{http://www.tcl.tk,Tcl/Tk web site} and the @uref{http://expect.nist.gov,Expect web site}. Julia Menapace first coined the term @emph{DejaGnu} to describe an earlier testing framework she wrote at Cygnus Support for testing GDB. When we replaced it with the Expect-based framework, it was like DejaGnu all over again. More importantly, it was also named after my daughter, Deja Snow Savoye, who was a toddler during DejaGnu's beginnings. DejaGnu offers several advantages for testing: @itemize @item The flexibility and consistency of the DejaGnu framework make it easy to write tests for any program, with either batch-oriented, or interactive programs. @item DejaGnu provides a layer of abstraction which allows you to write tests that are portable to any host or target where a program must be tested. For instance, a test for @code{GDB} can run from any supported host system on any supported target system. DejaGnu runs tests on many single board computers, whose operating software ranges from a simple boot monitor to a real-time OS. @item All tests have the same output format. This makes it easy to integrate testing into other software development processes. DejaGnu's output is designed to be parsed by other filtering script and it is also human readable. @item Using Tcl and Expect, it's easy to create wrappers for existing testsuites. By incorporating existing tests under DejaGnu, it's easier to have a single set of report analyse programs.. @end itemize Running tests requires two things: the testing framework and the testsuites themselves. Tests are usually written in Expect using Tcl, but you can also use a Tcl script to run a testsuite that is not based on Expect. Expect script filenames conventionally use @file{.exp} as a suffix. For example, the main implementation of the DejaGnu test driver is in the file @file{runtest.exp}. @node Release Notes, Design goals, What is DejaGnu?, Introduction @section New in this release The following major, user-visible changes have been introduced since version 1.5.3. @enumerate @item Support for target communication via SSH has been added. @item A large number of very old config and baseboard files have been removed. If you need to resurrect these, you can get them from version 1.5.3. If you can show that a board is still in use, it can be put back in the distribution. @item The @command{--status} command line option is now the default. This means that any error in the testsuite Tcl scripts will cause runtest to abort with exit status code 2. The @command{--status} option has been removed from the documentation, but will continue to be accepted for backward compatibility. @item @command{runtest} now exits with exit code 0 if the testsuite "passed", 1 if something unexpected happened (eg, FAIL, XPASS or UNRESOLVED), and 2 if an exception is raised by the Tcl interpreter. @item @command{runtest} now exits with the standard exit codes of programs that are terminated by the SIGINT, SIGTERM and SIGQUIT signals. @item The user-visible utility procedures @code{absolute}, @code{psource} and @code{slay} have been removed. If a testsuite uses any of these procedures, a copy of the procedure should be made and placed in the lib directory of the testsuite. @item Support was added for testing the D compiler. @item @file{~/.dejagnurc} is now loaded last, not first. This allows the user to have the ability to override anything in their environment (even the @file{site.exp} file specified by @code{$DEJAGNU}). @item The user-visible utility procedure @code{unsetenv} is @strong{deprecated} and will be removed in the next release. If a testsuite uses this procedure, a copy should be made and placed in the lib directory of the testsuite. @end enumerate @node Design goals, A POSIX Conforming Test Framework, Release Notes, Introduction @section Design goals @cindex design goals DejaGnu grew out of the internal needs of Cygnus Solutions (formerly Cygnus Support). Cygnus maintained and enhanced a variety of free programs in many different environments and needed a testing tool that: @itemize @item was useful to developers while fixing bugs; @item automated running many tests during a software release process; @item was portable among a variety of host computers; @item supported a cross-development environment; @item permitted testing of interactive programs like @code{GDB}; and @item permitted testing of batch-oriented programs like @code{GCC}. @end itemize Some of the requirements proved challenging. For example, interactive programs do not lend themselves very well to automated testing. But all the requirements are important. For instance, it is imperative to make sure that @code{GDB} works as well when cross-debugging as it does in a native configuration. Probably the greatest challenge was testing in a cross-development environment. Most cross-development environments are customized by each developer. Even when buying packaged boards from vendors there are many differences. The communication interfaces vary from a serial line to Ethernet. DejaGnu was designed with a modular communication setup, so that each kind of communication can be added as required and supported thereafter. Once a communication procedure is written, any test can use it. Currently DejaGnu can use @code{ssh}, @code{rsh}, @code{rlogin}, @code{telnet}, @code{tip}, and @code{kermit} for remote communications. @node A POSIX Conforming Test Framework, Installation, Design goals, Introduction @section A POSIX compliant test framework @cindex POSIX compliant test framework @cindex POSIX 1003.3 DejaGnu conforms to the POSIX 1003.3 standard for test frameworks. Rob Savoye was a member of that committee. POSIX standard 1003.3 defines what a testing framework needs to provide to create a POSIX compliant testsuite. This standard is primarily oriented to checking POSIX conformance, but its requirements also support testing of features not related to POSIX conformance. POSIX 1003.3 does not specify a particular testing framework, but at this time there is only one other POSIX conforming test framework. TET was created by Unisoft for a consortium comprised of X/Open, Unix International and the Open Software Foundation. @cindex assertions The POSIX documentation refers to @dfn{assertions}. An assertion is a description of behavior. For example, if a standard says ``The sun shall shine'', a corresponding assertion might be ``The sun is shining.'' A test based on this assertion would pass or fail depending on whether it is day or night. It is important to note that the standard being tested is never 1003.3; the standard being tested is some other standard, for which the assertions were written. As there is no testsuite to verify that testing frameworks are POSIX 1003.3 compliant, this is done by repeatedly reading the standard and experimenting. One of the main things POSIX 1003.3 does specify is the set of allowed output messages and their definitions. Four messages are supported for a required feature of POSIX conforming systems and a fifth for a conditional feature. DejaGnu supports all five output messages. In this sense a testsuite that uses exactly these messages can be considered POSIX compliant. These definitions specify the output of a test case: @table @asis @item PASS A test has succeeded. That is, it demonstrated that the assertion is true. @item FAIL A test has not succeeded -- the assertion is false. The @emph{FAIL} message is based on this test case only. Other messages are used to indicate a failure of the framework. As with @emph{PASS}, POSIX tests must return @emph{FAIL} rather than @emph{XFAIL} even if a failure was expected. @item XFAIL POSIX 1003.3 does not incorporate the notion of expected failures, so @emph{PASS}, instead of @emph{XPASS}, must also be returned for test cases which were expected to fail and did not. This means that @emph{PASS} is in some sense more ambiguous than if @emph{XPASS} is also used. @item UNRESOLVED A test produced indeterminate results. Usually, this means the test executed in an unexpected fashion. This outcome requires a human to go over results to determine if the test should have passed or failed. This message is also used for any test that requires human intervention because it is beyond the abilities of the testing framework. Any unresolved test should resolved to @emph{PASS} or @emph{FAIL} before a test run can be considered finished. Note that for POSIX, each assertion must produce a test result code. If the test isn't actually run, it must produce @emph{UNRESOLVED} rather than just leaving that test out of the output. This means that you have to be careful when writing tests to not carelessly use Tcl commands like @emph{return}---if you alter the flow of control of the Tcl code you must insure that every test still produces some result code. Here are some of the ways a test may wind up @emph{UNRESOLVED}: @end table @itemize @item Execution of a test is interrupted. @item A test does not produce a clear result. This is usually because there was an @emph{ERROR} from DejaGnu while processing the test, or because there were three or more @emph{WARNING} messages. Any @emph{WARNING} or @emph{ERROR} messages can invalidate the output of the test. This usually requires a human to examine the output to determine what really happened -- and to improve the test case. @item A test depends on a previous test, which has failed. @item The test was set up incorrectly. @item A test script aborts due to a Tcl error. In this case, the DejaGnu framework inserts an @emph{UNRESOLVED} result as a placeholder for an unknown number of tests that were not run because the script crashed. @end itemize @table @asis @item UNTESTED A test was not run. This is a placeholder used when there is no real test case yet. @end table @table @asis @item UNSUPPORTED There is no support for the tested case. This may mean that a conditional feature of an operating system, or of a compiler, is not implemented. DejaGnu also uses this message when a testing environment (often a ``bare board'' target) lacks basic support for compiling or running the test case. For example, a test for the system subroutine @emph{gethostname} would never work on a target board running only a boot monitor. @end table DejaGnu uses the same output procedures to produce these messages for all testsuites and these procedures are already known to conform to POSIX 1003.3. For a DejaGnu testsuite to conform to POSIX 1003.3, you must avoid the @emph{setup_xfail} procedure as described in the @emph{PASS} section above and you must be careful to return @emph{UNRESOLVED} where appropriate, as described in the @emph{UNRESOLVED} section above. @node Installation, , A POSIX Conforming Test Framework, Introduction @section Installation Refer to the @file{INSTALL} in the source distribution for detailed installation instructions. Note that there is no compilation step as with many other GNU packages, as DejaGnu consists of interpreted code only. Save for its own small testsuite, the DejaGnu distribution does not include any testsuites. Testsuites for the various GNU development tools are included with those packages. After configuring the top-level DejaGnu directory, unpack and configure the test directories for the tools you want to test; then, in each test directory, run @emph{make check} to build auxiliary programs required by some of the tests, and run the test suites. @node Running tests, Running other DejaGnu commands, Introduction, Top @chapter Running tests There are two ways to execute a testsuite. The most common way is when there is existing support in the @file{Makefile} of the tool being tested. This usually consists of a @emph{check} target. The other way is to execute the @code{runtest} program directly. To run @code{runtest} directly from the command line requires either all of the correct command line options, or a @ref{Local configuration file} must be set up correctly. @menu * Running 'make check': Make Check. * Running runtest: Runtest. * Output files: Output Files. @end menu @node Make Check, Runtest, , Running tests @section Running 'make check' To run tests from an existing collection, first use @code{configure} as usual to set up the build directory. Then type @code{make check}. If the @emph{check} target exists, it usually saves you some trouble. For instance, it can set up any auxiliary programs or other files needed by the tests. The most common file the @emph{check} target depends on is the @file{site.exp} file. The @file{site.exp} contains various variables that DejaGnu uses to determine the configuration of the program being tested. Once you have run @emph{make check} to build any auxiliary files, you can invoke the test driver @code{runtest} directly to repeat the tests. You will also have to execute @code{runtest} directly for test collections with no @emph{check} target in the @file{Makefile}. GNU Automake has built-in support for DejaGnu. To add DejaGnu support to your generated @file{Makefile.in}, just add the keyword @code{dejagnu} to the AUTOMAKE_OPTIONS variable in @file{Makefile.am}. This will ensure that the generated @file{Makefile.in} has a @code{check} target that invokes DejaGnu correctly. @xref{Tests,, DejaGnu Tests, automake, The GNU Automake Manual}. @node Runtest, Output Files, Make Check, Running tests @section Running runtest @pindex runtest @code{runtest} is the test driver for DejaGnu. You can specify two kinds of things on the @code{runtest} command line: command line options, and Tcl variables that are passed to the test scripts. The options are listed alphabetically below. @code{runtest} returns one of the following exit codes: @table @asis @item 0 if all tests passed including expected failures and unsupported tests. @item 1 if any test failed, passed unexpectedly, or was unresolved. @item 2 if Expect encountered any error in the test scripts. @end table @menu * Output States:: * Invoking runtest:: * Common Options: Common Operations. @end menu @node Output States, Invoking runtest, , Runtest @subsection Output States @cindex output states @file{runtest} flags the outcome of each test as one of these cases. See @ref{A POSIX Conforming Test Framework} for a discussion of how POSIX specifies the meanings of these cases. @table @asis @item PASS The most desirable outcome: the test was expected to succeed and did succeed. @item XPASS A pleasant kind of failure: a test was expected to fail, but succeeded. This may indicate progress; inspect the test case to determine whether you should amend it to stop expecting failure. @item FAIL A test failed, although it was expected to succeed. This may indicate regress; inspect the test case and the failing software to locate the bug. @item XFAIL A test failed, but it was expected to fail. This result indicates no change in a known bug. If a test fails because the operating system where the test runs lacks some facility required by the test, the outcome is @emph{UNSUPPORTED} instead. @item UNRESOLVED Output from a test requires manual inspection; the testsuite could not automatically determine the outcome. For example, your tests can report this outcome is when a test does not complete as expected. @item UNTESTED A test case is not yet complete, and in particular cannot yet produce a @emph{PASS} or @emph{FAIL}. You can also use this outcome in dummy ``tests'' that note explicitly the absence of a real test case for a particular property. @item UNSUPPORTED A test depends on a conditionally available feature that does not exist (in the configured testing environment). For example, you can use this outcome to report on a test case that does not work on a particular target because its operating system support does not include a required subroutine. @end table @code{runtest} may also display the following messages: @table @asis @item ERROR Indicates a major problem (detected by the test case itself) in running the test. This is usually an unrecoverable error, such as a missing file or loss of communication to the target. POSIX testsuites should not emit this message; use @emph{UNSUPPORTED}, @emph{UNTESTED}, or @emph{UNRESOLVED} instead, as appropriate. @item WARNING Indicates a possible problem in running the test. Usually warnings correspond to recoverable errors, or display an important message about the following tests. @item NOTE An informational message about the test case. @end table @node Invoking runtest, Common Operations, Output States, Runtest @subsection Invoking runtest @cindex runtest, invoking This is the full set of command line options that @code{runtest} recognizes. Option names may be abbreviated to the shortest unique string. @table @asis @item @code{-a}, @code{--all} Display all test output. By default, @emph{runtest} shows only the output of tests that produce unexpected results; that is, tests with status @emph{FAIL} (unexpected failure), @emph{XPASS} (unexpected success), or @emph{ERROR} (a severe error in the test case itself). Specify @code{--all} to see output for tests with status @emph{PASS} (success, as expected) @emph{XFAIL} (failure, as expected), or @emph{WARNING} (minor error in the test case itself). @item @code{--build [triplet]} @emph{triplet} is a system triplet of the form @emph{cpu-manufacturer-os}. This is the type of machine DejaGnu and the tools to be tested are built on. For a normal cross environment this is the same as the host, but for a Canadian cross, they are different. @item @code{-D0}, @code{-D1} Start the internal Tcl debugger. The Tcl debugger supports breakpoints, single stepping, and other common debugging activities. See the document @uref{http://expect.sourceforge.net/doc/tcl-debug.ps, Debugger for Tcl Applications} by Don Libes. If you specify @emph{-D1}, the @emph{expect} shell stops at a breakpoint as soon as DejaGnu invokes it. If you specify @emph{-D0}, DejaGnu starts as usual, but you can enter the debugger by sending an interrupt (e.g. by typing @key{Ctrl}-@key{c}). @item @code{--debug} Turns on the Expect internal debugging output. Debugging output is displayed as part of the @emph{runtest} output, and logged to a file called @file{dbg.log}. The extra debugging output does @emph{not} appear on standard output, unless the verbose level is greater than 2 (for instance, to see debug output immediately, specify @code{--debug -v -v}). The debugging output shows all attempts at matching the test output of the tool with the scripted patterns describing expected output. The output generated with @code{--strace} also goes into @file{dbg.log}. @item @code{--global_init [name]} Use @emph{name} as the global init file instead of @file{site.exp} in @emph{libdir}. The default is, of course, @file{site.exp}. Note that this option accepts a relative file name, interpreted starting at @emph{libdir}, so a file in a subdirectory may be used. This is probably less useful for most sites, but is orthogonal with the @code{--local_init} option and may be useful in large testing labs. @item @code{--help} Prints out a short summary of the @emph{runtest} options, then exits (even if you specify other options). @item @code{--host [triplet]} @emph{triplet} is a system triplet of the form @emph{cpu-manufactuer-os}. Use this option to override the default string recorded by your configuration's choice of host. This choice does not change how anything is actually configured unless --build is also specified; it affects @emph{only} DejaGnu procedures that compare the host string with particular values. The procedures @emph{ishost}, @emph{istarget}, @emph{isnative}, and @emph{setup_xfail} are affected by @code{--host}. In this usage, @emph{host} refers to the machine that the tests are to be run on, which may not be the same as the @emph{build} machine. If @code{--build} is also specified, then @code{--host} refers to the machine that the tests will be run on, not the machine DejaGnu is run on. @item @code{--host_board [name]} The host board to use. @item @code{--ignore [tests(s)] } The name(s) of specific tests to ignore. @item @code{--local_init [name]} Use @emph{name} as the testsuite local init file instead of @file{site.exp} in the current directory and in @emph{objdir}. The default is, of course, @file{site.exp}. Note that this option accepts a relative file name, so a file in a subdirectory may be used. @item @code{--log_dialog} Emit Expect output to stdout. The Expect output is usually only written to the @file{.log} file. By enabling this option, they are also printed to standard output. @item @code{--mail [address(es)]} Send test results to one or more email addresses. @item @code{--objdir [path]} Use @emph{path} as the top directory containing any auxiliary compiled test code. The default is '.'. Use this option to locate pre-compiled test code. You can normally prepare any auxiliary files needed with @emph{make}. @item @code{--outdir [path]} Write log files in directory @file{path}. The default is '.', the directory where you start @emph{runtest}. This option affects only the summary (@file{.sum}) and the detailed log files (@file{.log}). The DejaGnu debug log @file{dbg.log} always appears (when requested) in the local directory. @item @code{--reboot [name]} Reboot the target board when @code{runtest} starts. When running tests on a separate target board, it is safer to reboot the target to be certain of its state. However, when developing test scripts, rebooting can take a lot of time. @item @code{--srcdir [path]} Use @file{path} as the top directory for test scripts to run. @emph{runtest} looks in this directory for any subdirectory whose name begins with the toolname (specified with @code{--tool}). For instance, with @code{--tool gdb}, @emph{runtest} uses tests in subdirectories @file{gdb.*} (with the usual shell-like filename expansion). If you do not use @code{--srcdir}, @emph{runtest} looks for test directories under the current working directory. @item @code{--strace [n]} Turn on internal tracing for @emph{expect}, to n levels deep. By adjusting the level, you can control the extent to which your output expands multi-level Tcl statements. This allows you to ignore some levels of @emph{case} or @emph{if} statements. Each procedure call or control structure counts as one ``level''. The output is recorded in the same file, @file{dbg.log}, used for output from @code{--debug}. @item @code{--target [triplet]} Use this option to override the default setting (native testing). @emph{triplet} is a system triplet of the form @emph{cpu-manufacturer-os}. This option changes the configuration @code{runtest} uses for the default tool names, and other setup information. @item @code{--target_board [name(s)]} The list of target boards to run tests on. @item @code{--tool [name(s)]} Specifies which testsuite to run, and what initialization module to use. @code{--tool} is used @emph{only} for these two purposes. It is @emph{not} used to name the executable program to test. Executable tool names (and paths) are recorded in @file{site.exp} and you can override them by specifying Tcl variables on the command line. For example, including @code{--tool} gcc on the command line runs tests from all test subdirectories whose names match @file{gcc.*}, and uses one of the initialization modules named @file{config/*-gcc.exp}. To specify the name of the compiler (perhaps as an alternative path to what @emph{runtest} would use by default), use @emph{GCC=path-to-gcc} on the @emph{runtest} command line. @item @code{--tool_exec [name]} The path to the tool executable to test. @item @code{--tool_opts [options]} A list of additional options to pass to the tool. @item @code{-v}, @code{--verbose} Turns on more output. Repeating this option increases the amount of output displayed. Level one (@emph{-v}) is simply test output. Level two (@emph{-v -v}) shows messages on options, configuration, and process control. Verbose messages appear in the detailed (@file{*.log}) log file, but not in the summary (@file{*.sum}) log file. @item @code{-V}, @code{--version} Prints out the version numbers of DejaGnu, Expect, and Tcl. @item @code{-x}, @code{--xml} Generate XML output. The output file is named after the tool with an .xml extension. @item @file{testfile}.exp[=arg(s)] Specify the names of testsuites to run. By default, @emph{runtest} runs all tests for the tool, but you can restrict it to particular testsuites by giving the names of the @emph{.exp} scripts that control them. @emph{testsuite}.exp cannot include directory names, only plain filenames. @code{arg(s)} specifies a subset of test cases to run. For compiler or assembler tests, which often use a single @emph{.exp} script covering many different test case files, this option allows you to further restrict the tests by listing particular test cases. For larger testsuites such as that included in GCC, this can save a lot of time. Some tools support wildcards here, but this varies from tool to tool. Typically the wildcards @emph{?}, @emph{*}, and @emph{[chars]} are recognized. @item @code{tclvar}=value You can define Tcl variables for use by your test scripts in the same style used with @emph{make} for environment variables. For example, @emph{runtest GDB=gdb.old} defines a variable called @code{GDB}; when your scripts refer to @code{$GDB} in this run, they use the value @emph{gdb.old}. The default Tcl variables used for most tools are defined in the main DejaGnu @emph{Makefile}; their values are captured in the @file{site.exp} file. @end table @node Common Operations, , Invoking runtest, Runtest @subsection Common Options @cindex options, common Typically, you don't need to use any command line options. The @code{--tool} option is only required when there is more than one testsuite in the same directory. The default options are in the local @file{site.exp} file, created by @code{make site.exp}. For example, if the directory @file{gdb/testsuite} contains a collection of DejaGnu tests for GDB, you can run them like this: @example $ cd gdb/testsuite $ runtest --tool gdb @end example The test output follows, then ends with: @example === gdb Summary === # of expected passes 508 # of expected failures 103 /usr/latest/bin/gdb version 4.14.4 -nx @end example You can use the option @code{--srcdir} to point to some other directory containing a collection of tests: @example $ runtest --srcdir /devo/gdb/testsuite @end example By default, @code{runtest} prints only the names of the tests it runs, output from any tests that have unexpected results, and a summary showing how many tests passed and how many failed. To display output from all tests (whether or not they behave as expected), use the @code{-a} (all) option. For more verbose output about processes being run, communication, and so on, use @code{-v} (verbose). To see even more output, use multiple @code{-v} options. See @ref{Invoking runtest} for a more detailed explanation of each @code{runtest} option. @node Output Files, , Runtest, Running tests @section Output files DejaGnu always writes two kinds of output files. Summary output is written to the @file{.sum} file, and detailed output is written to the @file{.log} file. The tool name determines the prefix for these files. For example, after running with @code{--tool gdb}, the output files will be called @file{gdb.sum} and @file{gdb.log}. For troubleshooting, a debug log file that logs the operation of Expect is available. Each of these will be described in turn. @menu * Summary log file:: * Detailed log file:: * Debug log file:: @end menu @node Summary log file, Detailed log file, , Output Files @subsection Summary log file @cindex output file, summary log DejaGnu always produces a summary (@file{.sum}) output file. This summary lists the names of all test files run. For each test file, one line of output from each @code{pass} command (showing status @emph{PASS} or @emph{XPASS}) or @code{fail} command (status @emph{FAIL} or @emph{XFAIL}), trailing summary statistics that count passing and failing tests (expected and unexpected), the full pathname of the tool tested, and the version number of the tool. All possible outcomes, and all errors, are always reflected in the summary output file, regardless of whether or not you specify @code{--all}. If any of your tests use the procedures @code{unresolved}, @code{unsupported}, or @code{untested}, the summary output also tabulates the corresponding outcomes. For example, after running @code{runtest --tool binutils} a summary log file will be written to @file{binutils.sum}. Normally, DejaGnu writes this file in your current working directory. Use the @code{--outdir} option to select a different output directory. @strong{Sample summary log} @example Test Run By bje on Sat Nov 14 21:04:30 AEDT 2015 @ === gdb tests === Running ./gdb.t00/echo.exp ... PASS: Echo test Running ./gdb.all/help.exp ... PASS: help add-symbol-file PASS: help aliases PASS: help breakpoint "bre" abbreviation FAIL: help run "r" abbreviation Running ./gdb.t10/crossload.exp ... PASS: m68k-elf (elf-big) explicit format; loaded XFAIL: mips-ecoff (ecoff-bigmips) "ptype v_signed_char" signed C types @ === gdb Summary === # of expected passes 5 # of expected failures 1 # of unexpected failures 1 /usr/latest/bin/gdb version 4.6.5 -q @end example @node Detailed log file, Debug log file, Summary log file, Output Files @subsection Detailed log file @cindex output file, detailed log DejaGnu also saves a detailed log file (@file{.log}), showing any output generated by test cases as well as the summary output. For example, after running @code{runtest --tool binutils}, a detailed log file will be written to @file{binutils.log}. Normally, DejaGnu writes this file in your current working directory. Use the @code{--outdir} option to select a different output directory. @strong{Sample detailed log for g++ tests} @example Test Run By bje on Sat Nov 14 21:07:23 AEDT 2015 @ === g++ tests === Running ./g++.other/t01-1.exp ... PASS: operate delete Running ./g++.other/t01-2.exp ... FAIL: i960 bug EOF p0000646.C: In function `int warn_return_1 ()': p0000646.C:109: warning: control reaches end of non-void function p0000646.C: In function `int warn_return_arg (int)': p0000646.C:117: warning: control reaches end of non-void function p0000646.C: In function `int warn_return_sum (int, int)': p0000646.C:125: warning: control reaches end of non-void function p0000646.C: In function `struct foo warn_return_foo ()': p0000646.C:132: warning: control reaches end of non-void function Running ./g++.other/t01-4.exp ... FAIL: abort 900403_04.C:8: zero width for bit-field `foo' Running ./g++.other/t01-3.exp ... FAIL: segment violation 900519_12.C:9: parse error before `;' 900519_12.C:12: Segmentation violation /usr/latest/bin/gcc: Internal compiler error: program cc1plus got fatal signal @ === g++ Summary === # of expected passes 1 # of expected failures 3 /usr/latest/bin/g++ version cygnus-2.0.1 @end example @node Debug log file, , Detailed log file, Output Files @subsection Debug log file @cindex output file, debug log The @code{runtest} option @code{--debug} creates a file showing the output from Expect in debugging mode. The @file{dbg.log} file is created in the current directory. The log file shows the string sent to the tool being tested by each @code{send} command and the pattern it compares with the tool output by each @code{expect} command. The log messages begin with a message of the form: @example expect: does @{tool output@} (spawn_id n) match pattern @{expected pattern@}? @end example For every unsuccessful match, Expect issues a @emph{no} after this message. If other patterns are specified for the same Expect command, they are reflected also, but without the first part of the message (@emph{expect... match pattern}). When Expect finds a match, the log for the successful match ends with @emph{yes}, followed by a record of the Expect variables set to describe a successful match. @strong{Example debug log file for a GDB test} @example send: sent @{break gdbme.c:34\n@} to spawn id 6 expect: does @{@} (spawn_id 6) match pattern @{Breakpoint.*at.* file gdbme.c, line 34.*\(gdb\) $@}? no @{.*\(gdb\) $@}? no expect: does @{@} (spawn_id 0) match pattern @{return@} ? no @{\(y or n\) @}? no @{buffer_full@}? no @{virtual@}? no @{memory@}? no @{exhausted@}? no @{Undefined@}? no @{command@}? no break gdbme.c:34 Breakpoint 8 at 0x23d8: file gdbme.c, line 34. (gdb) expect: does @{break gdbme.c:34\r\nBreakpoint 8 at 0x23d8: file gdbme.c, line 34.\r\n(gdb) @} (spawn_id 6) match pattern @{Breakpoint.*at.* file gdbme.c, line 34.*\(gdb\) $@}? yes expect: set expect_out(0,start) @{18@} expect: set expect_out(0,end) @{71@} expect: set expect_out(0,string) @{Breakpoint 8 at 0x23d8: file gdbme.c, line 34.\r\n(gdb) @} epect: set expect_out(spawn_id) @{6@} expect: set expect_out(buffer) @{break gdbme.c:34\r\nBreakpoint 8 at 0x23d8: file gdbme.c, line 34.\r\n(gdb) @} PASS: 70 0 breakpoint line number in file @end example This example exhibits three properties of Expect and DejaGnu that might be surprising at first glance: @itemize @item Empty output for the first attempted match. The first set of attempted matches shown ran against the output @emph{@{@}} --- that is, no output. Expect begins attempting to match the patterns supplied immediately; often, the first pass is against incomplete output (or completely before all output, as in this case). @item Interspersed tool output. The beginning of the log entry for the second attempted match may be hard to spot: this is because the prompt @emph{@{(gdb) @}} appears on the same line, just before the @emph{expect:} that marks the beginning of the log entry. @item Fail-safe patterns. Many of the patterns tested are fail-safe patterns provided by GDB testing utilities, to reduce possible indeterminacy. It is useful to anticipate potential variations caused by extreme system conditions (GDB might issue the message @emph{virtual memory exhausted} in rare circumstances), or by changes in the tested program (@emph{Undefined command} is the likeliest outcome if the name of a tested command changes). The pattern @emph{@{return@}} is a particularly interesting fail-safe to notice; it checks for an unexpected @key{RET} prompt. This may happen, for example, if the tested tool can filter output through a pager. These fail-safe patterns (like the debugging log itself) are primarily useful while developing test scripts. Use the @code{error} procedure to make the actions for fail-safe patterns produce messages starting with @emph{ERROR} on standard output, and in the detailed log file. @end itemize @node Running other DejaGnu commands, Customizing DejaGnu, Running tests, Top @chapter Running other DejaGnu commands DejaGnu now features auxiliary commands not directly related to running tests, but somehow related to the broader purpose of testing. These commands are run via the @command{dejagnu} multiplex launcher, which locates an appropriate script and the required interpreter and then runs the requested command. @menu * Invoking dejagnu:: Command line options for the launcher itself. * Invoking dejagnu help:: Reading man pages for dejagnu subcommands. * Invoking dejagnu report card:: Summarizing test results from many tools. @end menu @node Invoking dejagnu, Invoking dejagnu help, Running other DejaGnu commands, Running other DejaGnu commands @section Invoking @command{dejagnu} @cindex dejagnu, invoking The @command{dejagnu} launcher is primarily designed to pass most options on to the scripts that it runs, but does process the @option{--help} and @option{--version} options entirely internally, while also recognizing the @option{--verbose} option. @example @command{dejagnu} [options...] @command{dejagnu} --help @command{dejagnu} --version @end example Note that the command names may contain multiple words. In this case, the command can be given as separate arguments to @command{dejagnu} or combined with dashes (@samp{-}); both forms are equivalent. All words of the command name must appear before any options. The search for a command terminates when an option is found. Note that the first valid command found is used. A longer command name can be shadowed by a shorter command name that happens to be a prefix of the longer name, if the command name is given as multiple arguments. The equivalent form with the longer command name combined using dashes into a single argument will correctly refer to the otherwise shadowed command. The @command{dejagnu} launcher can also be run using symbolic links, provided that the shell places the name under which @command{dejagnu} was invoked in @code{$0}. Any dash-separated words after ``dejagnu'' in the name of such a link are taken to be the leading words of a command name. The @command{dejagnu} launcher supports alternate implementations depending upon available interpreters. Options for the @command{dejagnu} launcher itself cannot be abbreviated, since the launcher has no way to know which abbreviations are unique and which would be ambiguous to the invoked command. @table @asis @item @code{--help} Print a help message instead of running a command. @item @code{-V}, @code{--version} Print a version banner for the launcher itself including the version of DejaGnu. Any command given is ignored. @item @code{-v}, @code{--verbose} Emit additional output describing the inner workings of the @command{dejagnu} launcher. This option is also passed on to the invoked command. @end table All arguments after the command name are passed to the invoked command. @node Invoking dejagnu help, Invoking dejagnu report card, Invoking dejagnu, Running other DejaGnu commands @section Invoking @command{dejagnu help} @cindex dejagnu help, invoking The @command{dejagnu help} tool displays long-form documentation for DejaGnu auxiliary commands that are invoked using the @command{dejagnu} launcher. @example @command{dejagnu help} [options...] @end example Again, command names may contain multiple words. This command forms an operand by joining all words in the command name using dashes (@samp{-}) and prepending @samp{dejagnu-}. This is then used as the name of a manual page and passed to the @command{man} command. If the manual page is in a particular directory relative to the script implementing this command, a full file name is produced, otherwise, @command{man} performs its normal search. The @option{--verbose} option causes additional output describing the inner workings of the @command{dejagnu help} command to be produced. The @option{--path}, @option{-w}, and @option{-W} options are passed to @command{man}. @node Invoking dejagnu report card, , Invoking dejagnu help, Running other DejaGnu commands @section Invoking @command{dejagnu report card} @cindex dejagnu report card, invoking @cindex dejagnu report-card, invoking The @command{dejagnu report card} tool produces a tabular summary of the results from test runs by reading the summary files that DejaGnu produces. @example @command{dejagnu report card} [