From: Tom de Vries <tdevries@suse.de>
To: gdb-patches@sourceware.org
Subject: [pushed 1/6] [gdb/testsuite] Fix gdb.guile/guile.exp for remote host
Date: Wed, 29 Mar 2023 08:01:59 +0200 [thread overview]
Message-ID: <20230329060204.32690-1-tdevries@suse.de> (raw)
Fix test-case gdb.guile/guile.exp for remote host using gdb_remote_download.
Tested on x86_64-linux.
---
gdb/testsuite/gdb.guile/guile.exp | 38 +++++++++++++++++--------------
1 file changed, 21 insertions(+), 17 deletions(-)
diff --git a/gdb/testsuite/gdb.guile/guile.exp b/gdb/testsuite/gdb.guile/guile.exp
index 4db2f7cd309..7d0c063583d 100644
--- a/gdb/testsuite/gdb.guile/guile.exp
+++ b/gdb/testsuite/gdb.guile/guile.exp
@@ -20,6 +20,8 @@ load_lib gdb-guile.exp
clean_restart
+set host_source2_scm [gdb_remote_download host $srcdir/$subdir/source2.scm]
+
# Do this instead of the skip_guile_check.
# We want to do some tests when Guile is not present.
gdb_test_multiple "guile (display 23) (newline)" "verify guile support" {
@@ -32,7 +34,7 @@ gdb_test_multiple "guile (display 23) (newline)" "verify guile support" {
# If Guile is not supported, verify that sourcing a guile script
# causes an error.
- gdb_test "source $srcdir/$subdir/source2.scm" \
+ gdb_test "source $host_source2_scm" \
"Error in sourced command file:.*" \
"source source2.scm when guile disabled"
@@ -63,7 +65,7 @@ gdb_test_multiline "show guile command" \
"end" "" \
"show user zzq" "User command \"zzq\":.* guile.*\\(print 23\\).* end"
-gdb_test "source $srcdir/$subdir/source2.scm" "yes" "source source2.scm"
+gdb_test "source $host_source2_scm" "yes" "source source2.scm"
gdb_test "source -s source2.scm" "yes"
@@ -81,19 +83,21 @@ gdb_test "guile (print a)" "= .*aliases -- User-defined aliases of other command
"verify help to uiout"
# Verify that we can source a guile script using ~ for the HOME directory.
-save_vars { env(HOME) } {
- # Create a new directory to act as a temporary HOME directory.
- set tmp_home [standard_output_file tmp_home]
- file mkdir $tmp_home
-
- # Copy the file we want to source into the new HOME directory.
- gdb_remote_download host ${srcdir}/${subdir}/source2.scm \
- ${tmp_home}/source2.scm
-
- # Arrange to use the new HOME directory.
- set env(HOME) $tmp_home
- clean_restart
-
- # Finally, source the file out of our new HOME directory.
- gdb_test "source ~/source2.scm" "yes"
+if { ![is_remote host ] } {
+ save_vars { env(HOME) } {
+ # Create a new directory to act as a temporary HOME directory.
+ set tmp_home [standard_output_file tmp_home]
+ file mkdir $tmp_home
+
+ # Copy the file we want to source into the new HOME directory.
+ gdb_remote_download host ${srcdir}/${subdir}/source2.scm \
+ ${tmp_home}/source2.scm
+
+ # Arrange to use the new HOME directory.
+ set env(HOME) $tmp_home
+ clean_restart
+
+ # Finally, source the file out of our new HOME directory.
+ gdb_test "source ~/source2.scm" "yes"
+ }
}
base-commit: aec101ab06697221d2bc2f82b3a65fb92054ed9f
--
2.35.3
next reply other threads:[~2023-03-29 6:02 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-29 6:01 Tom de Vries [this message]
2023-03-29 6:02 ` [pushed 2/6] [gdb/testsuite] Fix gdb.guile/scm-cmd.exp without readline Tom de Vries
2023-03-29 6:02 ` [pushed 3/6] [gdb/testsuite] Fix gdb.guile/scm-objfile-script.exp for remote host Tom de Vries
2023-03-29 6:02 ` [pushed 4/6] " Tom de Vries
2023-03-29 6:02 ` [pushed 5/6] [gdb/testsuite] Fix /gdb.guile/scm-parameter.exp " Tom de Vries
2023-03-29 6:02 ` [pushed 6/6] [gdb/testsuite] Fix gdb.guile/scm-symbol.exp " Tom de Vries
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230329060204.32690-1-tdevries@suse.de \
--to=tdevries@suse.de \
--cc=gdb-patches@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).