[4/5] gdb/testsuite: Disable some tests that are broken on remote Windows host

Message ID 20230419193046.548783-5-sandra@codesourcery.com
State New
Headers
Series gdb/testsuite: Miscellaneous fixes |

Commit Message

Sandra Loosemore April 19, 2023, 7:30 p.m. UTC
  These testcases assume host==build or that the remote host has a Posix
shell to run commands in.  Don't try to run them if that's not the case.
---
 gdb/testsuite/gdb.base/bad-file.exp            | 6 ++++++
 gdb/testsuite/gdb.base/early-init-file.exp     | 6 ++++++
 gdb/testsuite/gdb.base/empty-host-env-vars.exp | 6 ++++++
 3 files changed, 18 insertions(+)
  

Comments

Tom Tromey April 21, 2023, 2:46 p.m. UTC | #1
>>>>> "Sandra" == Sandra Loosemore <sandra@codesourcery.com> writes:

Sandra> These testcases assume host==build or that the remote host has a Posix
Sandra> shell to run commands in.  Don't try to run them if that's not the case.
 
Sandra> +# The pathnames and shell commands in this test don't work on Windows host.
Sandra> +if { [is_remote host] && [ishost *-*-mingw*] } {
Sandra> +    untested "does not work on remote Windows host"
Sandra> +    return 0

I guess this spot can't really use 'require' but the other ones could.

Tom
  
Tom Tromey April 21, 2023, 2:52 p.m. UTC | #2
>>>>> "Sandra" == Sandra Loosemore <sandra@codesourcery.com> writes:

Sandra> +# The pathnames and shell commands in this test don't work on Windows host.
Sandra> +if { [is_remote host] && [ishost *-*-mingw*] } {

It belatedly occurred to me to wonder if the "is_remote host" part is needed.
Like, would this work on native Windows but just not cross Windows?

Tom
  
Sandra Loosemore April 21, 2023, 7:33 p.m. UTC | #3
On 4/21/23 08:52, Tom Tromey wrote:
>>>>>> "Sandra" == Sandra Loosemore <sandra@codesourcery.com> writes:
> 
> Sandra> +# The pathnames and shell commands in this test don't work on Windows host.
> Sandra> +if { [is_remote host] && [ishost *-*-mingw*] } {
> 
> It belatedly occurred to me to wonder if the "is_remote host" part is needed.
> Like, would this work on native Windows but just not cross Windows?

Is it even possible to run the testsuite on native Windows without being 
inside Cygwin or some similar environment?  :-S  We don't do that here, 
anyway -- only Canadian-cross with remote Windows host.

-Sandra
  
Tom Tromey April 22, 2023, 12:11 a.m. UTC | #4
>> Like, would this work on native Windows but just not cross Windows?

Sandra> Is it even possible to run the testsuite on native Windows without
Sandra> being inside Cygwin or some similar environment?  :-S

I have no idea, I've never managed to get the gdb test suite working at
all on Windows.  Though to be clear I haven't tried very hard.

Tom
  

Patch

diff --git a/gdb/testsuite/gdb.base/bad-file.exp b/gdb/testsuite/gdb.base/bad-file.exp
index 5d8dfee8fea..98101d9e15a 100644
--- a/gdb/testsuite/gdb.base/bad-file.exp
+++ b/gdb/testsuite/gdb.base/bad-file.exp
@@ -20,6 +20,12 @@ 
 # print different text then the plan is to update the expected text
 # instead of making this test linux-only or some such.
 
+# The pathnames and shell commands in this test don't work on Windows host.
+if { [is_remote host] && [ishost *-*-mingw*] } {
+    untested "does not work on remote Windows host"
+    return 0
+}
+
 # There is no such file, but we still use the normal mechanism to pick
 # its name and path.
 standard_testfile
diff --git a/gdb/testsuite/gdb.base/early-init-file.exp b/gdb/testsuite/gdb.base/early-init-file.exp
index fcd1ff041a1..0bb2c456a3e 100644
--- a/gdb/testsuite/gdb.base/early-init-file.exp
+++ b/gdb/testsuite/gdb.base/early-init-file.exp
@@ -15,6 +15,12 @@ 
 
 # Test GDB's early init file mechanism.
 
+# Test assumes host == build.
+if {[is_remote host]} {
+    untested "does not work on remote host"
+    return 0
+}
+
 standard_testfile
 
 # Compile the test executable.
diff --git a/gdb/testsuite/gdb.base/empty-host-env-vars.exp b/gdb/testsuite/gdb.base/empty-host-env-vars.exp
index 96240311c24..a28798ff69a 100644
--- a/gdb/testsuite/gdb.base/empty-host-env-vars.exp
+++ b/gdb/testsuite/gdb.base/empty-host-env-vars.exp
@@ -13,6 +13,12 @@ 
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
+# This test assumes host == build.
+if {[is_remote host]} {
+    untested "does not work on remote host"
+    return 0
+}
+
 # GDB reads some environment variables on startup, make sure it behaves
 # correctly if these variables are defined but empty.