Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Yao Qi <yao@codesourcery.com>
To: <gdb-patches@sourceware.org>
Subject: [PATCH 3/3] Copy .py files to remote host
Date: Fri, 15 Aug 2014 04:04:00 -0000	[thread overview]
Message-ID: <1408075184-25947-4-git-send-email-yao@codesourcery.com> (raw)
In-Reply-To: <1408075184-25947-1-git-send-email-yao@codesourcery.com>

Some gdb.python/*.exp tests fail because the .py files aren't copied
to the (remote) host.  This patch is to copy needed .py files to host.
Most of gdb.python/*.exp tests do this.

gdb/testsuite:

2014-08-14  Yao Qi  <yao@codesourcery.com>

	* gdb.python/py-finish-breakpoint.exp: Copy .py file to host.
	* gdb.python/py-finish-breakpoint2.exp: Likewise.
	* gdb.python/python.exp: Likewise.  Use .py file on the host
	instead of the build.
---
 gdb/testsuite/gdb.python/py-finish-breakpoint.exp  | 6 +++---
 gdb/testsuite/gdb.python/py-finish-breakpoint2.exp | 4 +++-
 gdb/testsuite/gdb.python/python.exp                | 7 +++++--
 3 files changed, 11 insertions(+), 6 deletions(-)

diff --git a/gdb/testsuite/gdb.python/py-finish-breakpoint.exp b/gdb/testsuite/gdb.python/py-finish-breakpoint.exp
index 43d0d81..b30dccc 100644
--- a/gdb/testsuite/gdb.python/py-finish-breakpoint.exp
+++ b/gdb/testsuite/gdb.python/py-finish-breakpoint.exp
@@ -53,9 +53,6 @@ if { $gdb_py_is_py24 == 1 } {
     return 0
 }
 
-set python_file ${srcdir}/${subdir}/${testfile}.py
-
-
 # Skip all tests if Python scripting is not enabled.
 if { [skip_python_tests] } { continue }
 
@@ -71,6 +68,9 @@ if ![runto_main] then {
     return 0
 }
 
+set python_file [gdb_remote_download host \
+		     ${srcdir}/${subdir}/${testfile}.py]
+
 gdb_test_no_output "set confirm off" "disable confirmation"
 gdb_test "source $python_file" "Python script imported.*" \
          "import python scripts"
diff --git a/gdb/testsuite/gdb.python/py-finish-breakpoint2.exp b/gdb/testsuite/gdb.python/py-finish-breakpoint2.exp
index 95f55b7..203fc99 100644
--- a/gdb/testsuite/gdb.python/py-finish-breakpoint2.exp
+++ b/gdb/testsuite/gdb.python/py-finish-breakpoint2.exp
@@ -19,7 +19,6 @@
 load_lib gdb-python.exp
 
 standard_testfile .cc
-set pyfile  ${srcdir}/${subdir}/${testfile}.py
 
 if {[prepare_for_testing $testfile.exp $testfile $srcfile {debug c++}]} {
     return -1
@@ -33,6 +32,9 @@ if ![runto_main] then {
     return 0
 }
 
+set pyfile [gdb_remote_download host \
+		${srcdir}/${subdir}/${testfile}.py]
+
 #
 # Check FinishBreakpoints against C++ exceptions
 #
diff --git a/gdb/testsuite/gdb.python/python.exp b/gdb/testsuite/gdb.python/python.exp
index c03c284..49f6e88 100644
--- a/gdb/testsuite/gdb.python/python.exp
+++ b/gdb/testsuite/gdb.python/python.exp
@@ -30,6 +30,9 @@ gdb_exit
 gdb_start
 gdb_reinitialize_dir $srcdir/$subdir
 
+set remote_source2_py [gdb_remote_download host \
+			   ${srcdir}/${subdir}/source2.py]
+
 # Do this instead of the skip_python_check.
 # We want to do some tests when Python is not present.
 gdb_test_multiple "python print (23)" "verify python support" {
@@ -38,7 +41,7 @@ gdb_test_multiple "python print (23)" "verify python support" {
 
       # If Python is not supported, verify that sourcing a python script
       # causes an error.
-      gdb_test "source $srcdir/$subdir/source2.py" \
+      gdb_test "source $remote_source2_py" \
 	  "Error in sourced command file:.*" \
 	  "source source2.py when python disabled"
 
@@ -73,7 +76,7 @@ gdb_py_test_multiple "indented multi-line python command" \
   "foo ()" "" \
   "end" "hello, world!"
 
-gdb_test "source $srcdir/$subdir/source2.py" "yes" "source source2.py"
+gdb_test "source $remote_source2_py" "yes" "source source2.py"
 
 gdb_test "source -s source2.py" "yes" "source -s source2.py"
 
-- 
1.9.0


  reply	other threads:[~2014-08-15  4:04 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-15  4:04 [PATCH 0/3] Keep track of files copied to host and target Yao Qi
2014-08-15  4:04 ` Yao Qi [this message]
2014-08-15  4:04 ` [PATCH 2/3] Keep track of downloaded file in gdb_remote_download Yao Qi
2014-08-15  4:04 ` [PATCH 1/3] Extend cleanfiles for multiple hosts Yao Qi
2014-08-15  5:00 ` [PATCH 0/3] Keep track of files copied to host and target Doug Evans
2014-08-15  6:08   ` Yao Qi
2014-08-16  0:38     ` Doug Evans
2014-08-20  6:54       ` Yao Qi
2014-08-20 15:17         ` Pedro Alves
2014-08-20 15:48         ` Doug Evans
2014-08-21  0:35           ` Yao Qi
2014-08-21 17:32             ` Doug Evans
2014-08-22  6:14               ` Yao Qi

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=1408075184-25947-4-git-send-email-yao@codesourcery.com \
    --to=yao@codesourcery.com \
    --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