diff options
Diffstat (limited to 'gdb/testsuite/gdb.guile/scm-parameter.exp')
-rw-r--r-- | gdb/testsuite/gdb.guile/scm-parameter.exp | 94 |
1 files changed, 49 insertions, 45 deletions
diff --git a/gdb/testsuite/gdb.guile/scm-parameter.exp b/gdb/testsuite/gdb.guile/scm-parameter.exp index e35428a..5483b81 100644 --- a/gdb/testsuite/gdb.guile/scm-parameter.exp +++ b/gdb/testsuite/gdb.guile/scm-parameter.exp @@ -26,7 +26,7 @@ gdb_install_guile_utils gdb_install_guile_module proc scm_param_test_maybe_no_output { command pattern args } { - if [string length $pattern] { + if {[string length $pattern]} { gdb_test $command $pattern $args } else { gdb_test_no_output $command $args @@ -39,7 +39,8 @@ if { [is_remote host] } { gdb_test "guile (print (parameter-value \"directories\"))" \ "\\\$cdir.\\\$cwd" } else { - set escaped_directory [string_to_regexp "$srcdir/$subdir"] + set directory [host_file_normalize "$::srcdir/$::subdir"] + set escaped_directory [string_to_regexp $directory] gdb_test "guile (print (parameter-value \"directories\"))" \ "$escaped_directory.\\\$cdir.\\\$cwd" } @@ -109,7 +110,7 @@ with_test_prefix "test-enum-param" { gdb_test_no_output "set print test-enum-param two" gdb_test "show print test-enum-param" "The state of the enum is two." "show new value" gdb_test "guile (print (parameter-value test-enum-param))" "two" "enum parameter value, two" - gdb_test "set print test-enum-param three" "Undefined item: \"three\".*" "set invalid enum parameter" + gdb_test "set print test-enum-param three" "Undefined item: \"three\".*" "set invalid enum parameter" } # Test integer parameters. @@ -305,7 +306,7 @@ with_test_prefix "test-file-param" { gdb_test_no_output "set test-file-param bar.txt" gdb_test "show test-file-param" "The name of the file is bar.txt." "show new value" gdb_test "guile (print (parameter-value test-file-param))" "bar.txt" " new parameter value" - gdb_test "set test-file-param" "Argument required.*" + gdb_test "set test-file-param" "Argument required.*" } # Test a parameter that is not documented. @@ -565,47 +566,50 @@ rename scm_param_test_maybe_no_output "" # Test a color parameter. -with_ansi_styling_terminal { - # This enables 256 colors support and disables colors approximation. - setenv TERM xterm-256color - setenv COLORTERM truecolor - - # Start with a fresh gdb. - gdb_exit - gdb_start - gdb_reinitialize_dir $srcdir/$subdir - - gdb_install_guile_utils - gdb_install_guile_module - - # We use "." here instead of ":" so that this works on win32 too. - set escaped_directory [string_to_regexp "$srcdir/$subdir"] - - gdb_test_multiline "color gdb parameter" \ - "guile" "" \ - "(define test-color-param" "" \ - " (make-parameter \"print test-color-param\"" "" \ - " #:command-class COMMAND_DATA" "" \ - " #:parameter-type PARAM_COLOR" "" \ - " #:doc \"When set, test param does something useful. When disabled, does nothing.\"" "" \ - " #:show-doc \"Show the state of the test-color-param.\"" "" \ - " #:set-doc \"Set the state of the test-color-param.\"" "" \ - " #:show-func (lambda (self value)" "" \ - " (format #f \"The state of the test-color-param is ~a.\" value))" "" \ - " #:initial-value (make-color \"green\")))" "" \ - "(register-parameter! test-color-param)" "" \ - "end" - - with_test_prefix "test-color-param" { - with_test_prefix "initial-value" { - gdb_test "guile (print (parameter-value test-color-param))" "= #<gdb:color green COLORSPACE_ANSI_8COLOR>" "color parameter value (green)" - gdb_test "show print test-color-param" "The state of the test-color-param is green." "show initial value" - gdb_test_no_output "set print test-color-param 255" - } - with_test_prefix "new-value" { - gdb_test "show print test-color-param" "The state of the test-color-param is 255." "show new value" - gdb_test "guile (print (parameter-value test-color-param))" "= #<gdb:color 255 COLORSPACE_XTERM_256COLOR>" "color parameter value (255)" - gdb_test "set print test-color-param 256" "integer 256 out of range.*" "set invalid color parameter" +if { ![is_remote host] } { + with_ansi_styling_terminal { + + # This enables 256 colors support and disables colors approximation. + setenv TERM xterm-256color + setenv COLORTERM truecolor + + # Start with a fresh gdb. + gdb_exit + gdb_start + gdb_reinitialize_dir $srcdir/$subdir + + gdb_install_guile_utils + gdb_install_guile_module + + # We use "." here instead of ":" so that this works on win32 too. + set escaped_directory [string_to_regexp "$srcdir/$subdir"] + + gdb_test_multiline "color gdb parameter" \ + "guile" "" \ + "(define test-color-param" "" \ + " (make-parameter \"print test-color-param\"" "" \ + " #:command-class COMMAND_DATA" "" \ + " #:parameter-type PARAM_COLOR" "" \ + " #:doc \"When set, test param does something useful. When disabled, does nothing.\"" "" \ + " #:show-doc \"Show the state of the test-color-param.\"" "" \ + " #:set-doc \"Set the state of the test-color-param.\"" "" \ + " #:show-func (lambda (self value)" "" \ + " (format #f \"The state of the test-color-param is ~a.\" value))" "" \ + " #:initial-value (make-color \"green\")))" "" \ + "(register-parameter! test-color-param)" "" \ + "end" + + with_test_prefix "test-color-param" { + with_test_prefix "initial-value" { + gdb_test "guile (print (parameter-value test-color-param))" "= #<gdb:color green COLORSPACE_ANSI_8COLOR>" "color parameter value (green)" + gdb_test "show print test-color-param" "The state of the test-color-param is green." "show initial value" + gdb_test_no_output "set print test-color-param 255" + } + with_test_prefix "new-value" { + gdb_test "show print test-color-param" "The state of the test-color-param is 255." "show new value" + gdb_test "guile (print (parameter-value test-color-param))" "= #<gdb:color 255 COLORSPACE_XTERM_256COLOR>" "color parameter value (255)" + gdb_test "set print test-color-param 256" "integer 256 out of range.*" "set invalid color parameter" + } } } } |