mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-19 09:14:14 +08:00
[gdb/testsuite] Check for valid test name
When running gdb.base/batch-exit-status.exp I noticed that the test name contains a newline: ... PASS: gdb.base/batch-exit-status.exp: : No such file or directory\.^M : No such file or directory\.: [lindex $result 2] == 0 ... Check for this in ::CheckTestNames::check, such that we have a warning: ... PASS: gdb.base/batch-exit-status.exp: : No such file or directory\.^M : No such file or directory\.: [lindex $result 2] == 0 WARNING: Newline in test name ... Tested on x86_64-linux.
This commit is contained in:
@ -93,6 +93,13 @@ namespace eval ::CheckTestNames {
|
||||
return $message
|
||||
}
|
||||
|
||||
# Check if MESSAGE is a well-formed test name.
|
||||
proc _check_well_formed_name { message } {
|
||||
if { [regexp \n $message]} {
|
||||
warning "Newline in test name"
|
||||
}
|
||||
}
|
||||
|
||||
# Check if MESSAGE contains either the source path or the build path.
|
||||
# This will result in test names that can't easily be compared between
|
||||
# different runs of GDB.
|
||||
@ -110,6 +117,8 @@ namespace eval ::CheckTestNames {
|
||||
if [ _check_duplicates $message ] {
|
||||
clone_output "DUPLICATE: $message"
|
||||
}
|
||||
|
||||
_check_well_formed_name $message
|
||||
}
|
||||
|
||||
# If COUNT is greater than zero, disply PREFIX followed by COUNT.
|
||||
|
Reference in New Issue
Block a user