This is the mail archive of the gdb-cvs@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[binutils-gdb] Fix test failure with Rust 1.18 and 1.19


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=ec8df23454873916c6b6b918967af631b268acd8

commit ec8df23454873916c6b6b918967af631b268acd8
Author: Tom Tromey <tom@tromey.com>
Date:   Thu May 18 17:31:41 2017 -0600

    Fix test failure with Rust 1.18 and 1.19
    
    With Rust 1.18 and 1.19, I saw some test suite failures.  They were
    all of the same form -- Box seems to be qualified in the output now,
    like:
    
      print box_some
      $64 = core::option::Option<alloc::boxed::Box<u8>>::Some(0x7ffff6c21018 "\001\000")
    
    ... where the test was expecting Option<Box<u8>>.
    
    This patch fixes the problem in a way that should work with earlier
    versions of Rust.
    
    gdb/testsuite/ChangeLog
    2017-05-18  Tom Tromey  <tom@tromey.com>
    
    	* gdb.rust/simple.exp: Allow Box to be qualified.

Diff:
---
 gdb/testsuite/ChangeLog           | 4 ++++
 gdb/testsuite/gdb.rust/simple.exp | 8 ++++----
 2 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index 40df91e..a3a75bc 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,3 +1,7 @@
+2017-05-18  Tom Tromey  <tom@tromey.com>
+
+	* gdb.rust/simple.exp: Allow Box to be qualified.
+
 2017-05-18  Thomas Preud'homme  <thomas.preudhomme@arm.com>
 
 	* gdb.base/float.exp: Expect GDB prompt for targets without FPU.
diff --git a/gdb/testsuite/gdb.rust/simple.exp b/gdb/testsuite/gdb.rust/simple.exp
index 0bcc83e..872b22c 100644
--- a/gdb/testsuite/gdb.rust/simple.exp
+++ b/gdb/testsuite/gdb.rust/simple.exp
@@ -198,8 +198,8 @@ gdb_test "print str_some" \
 gdb_test "print str_none" " = core::option::Option<collections::string::String>::None"
 gdb_test "print int_some" " = core::option::Option::Some\\(1\\)"
 gdb_test "print int_none" " = core::option::Option::None"
-gdb_test "print box_some" " = core::option::Option<Box<u8>>::Some\\(.*\\)"
-gdb_test "print box_none" " = core::option::Option<Box<u8>>::None"
+gdb_test "print box_some" " = core::option::Option<\[a-z:\]*Box<u8>>::Some\\(.*\\)"
+gdb_test "print box_none" " = core::option::Option<\[a-z:\]*Box<u8>>::None"
 gdb_test "print custom_some" \
     " = simple::NonZeroOptimized::Value\\(collections::string::String .*"
 gdb_test "print custom_none" " = simple::NonZeroOptimized::Empty"
@@ -241,8 +241,8 @@ gdb_test "print (1)" " = 1"
 gdb_test "print 23..97.0" "Range expression with different types"
 
 gdb_test "print (*parametrized.next.val)" \
-    " = simple::ParametrizedStruct<i32> {next: simple::ParametrizedEnum<Box<simple::ParametrizedStruct<i32>>>::Empty, value: 1}"
+    " = simple::ParametrizedStruct<i32> {next: simple::ParametrizedEnum<\[a-z:\]*Box<simple::ParametrizedStruct<i32>>>::Empty, value: 1}"
 gdb_test "print parametrized.next.val" \
     " = \\(simple::ParametrizedStruct<i32> \\*\\) $hex"
 gdb_test "print parametrized" \
-    " = simple::ParametrizedStruct<i32> \\{next: simple::ParametrizedEnum<Box<simple::ParametrizedStruct<i32>>>::Val\\{val: $hex\\}, value: 0\\}"
+    " = simple::ParametrizedStruct<i32> \\{next: simple::ParametrizedEnum<\[a-z:\]*Box<simple::ParametrizedStruct<i32>>>::Val\\{val: $hex\\}, value: 0\\}"


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]