From: Tom Tromey Date: Thu, 31 Dec 2020 21:55:27 +0000 (-0700) Subject: Update gdb.rust tests for Rust 1.49 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=9b243007ba0701c7ae07dc11d0f4a0c81b1bc49f;p=binutils-gdb.git Update gdb.rust tests for Rust 1.49 Rust 1.49 was released today, and it includes some library changes which caused some gdb.rust tests to fail. This patch adapts the test suite to the new output. I also verified that this continues to work with Rust 1.48. gdb/testsuite/ChangeLog 2020-12-31 Tom Tromey * gdb.rust/simple.exp: Update output for Rust 1.49. --- diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index c61fab8c07c..d184b782049 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2020-12-31 Tom Tromey + + * gdb.rust/simple.exp: Update output for Rust 1.49. + 2020-12-31 Bernd Edlinger * gdb.cp/step-and-next-inline.exp: Fix test case. diff --git a/gdb/testsuite/gdb.rust/simple.exp b/gdb/testsuite/gdb.rust/simple.exp index 882c2e07bcd..00f4547a00b 100644 --- a/gdb/testsuite/gdb.rust/simple.exp +++ b/gdb/testsuite/gdb.rust/simple.exp @@ -262,8 +262,14 @@ gdb_test_multiple "print str_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<\[a-z:\]*Box>::Some\\(.*\\)" -gdb_test "print box_none" " = core::option::Option<\[a-z:\]*Box>::None" +# The result expressions are a bit lax here, to handle the fact that +# the output varies between Rust versions. Mostly we just want to +# check for the presence "Option", "Box", "u8", and either "Some" or +# "None". +gdb_test "print box_some" \ + " = core::option::Option<\[a-z:\]*Box>::Some\\(.*\\)" +gdb_test "print box_none" \ + " = core::option::Option<\[a-z:\]*Box>::None" set pass_pattern \ " = simple::NonZeroOptimized::Value\\(\[a-z\]+::string::String .*" @@ -332,11 +338,11 @@ gdb_test "print (1)" " = 1" gdb_test "print 23..97.0" "Range expression with different types" gdb_test "print (*parametrized.next.val)" \ - " = simple::ParametrizedStruct {next: simple::ParametrizedEnum<\[a-z:\]*Box>>::Empty, value: 1}" + " = simple::ParametrizedStruct {next: simple::ParametrizedEnum<\[a-z:\]*Box.*>>::Empty, value: 1}" gdb_test "print parametrized.next.val" \ " = \\(\\*mut simple::ParametrizedStruct\\) $hex" gdb_test "print parametrized" \ - " = simple::ParametrizedStruct \\{next: simple::ParametrizedEnum<\[a-z:\]*Box>>::Val\\{val: $hex\\}, value: 0\\}" + " = simple::ParametrizedStruct \\{next: simple::ParametrizedEnum<\[a-z:\]*Box.*>>::Val\\{val: $hex\\}, value: 0\\}" gdb_test_sequence "ptype/o SimpleLayout" "" { "/\\* offset | size \\*/ type = struct simple::SimpleLayout {"