Fix a typo in the recent Rust support and update regression tests
authorDodji Seketeli <dodji@redhat.com>
Thu, 24 Jan 2019 09:31:57 +0000 (10:31 +0100)
committerDodji Seketeli <dodji@redhat.com>
Thu, 24 Jan 2019 09:35:05 +0000 (10:35 +0100)
* configure.ac: Fix the typo HAS_LANG_Rust into HAS_DW_LANG_Rust.
* tests/data/test-diff-dwarf/test46-readme.txt: Add new file to
the test suite.
* tests/data/test-diff-dwarf/test46-rust-libone.so: Likewise.
* tests/data/test-diff-dwarf/test46-rust-libtwo.so: Likewise.
* tests/data/test-diff-dwarf/test46-rust-report-0.txt: Likewise.
* tests/test-diff-dwarf.cc (in_out_specs): Update the tests array
to compare the two new binaries included above.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
configure.ac
tests/data/test-diff-dwarf/test46-readme.txt [new file with mode: 0644]
tests/data/test-diff-dwarf/test46-rust-libone.so [new file with mode: 0755]
tests/data/test-diff-dwarf/test46-rust-libtwo.so [new file with mode: 0755]
tests/data/test-diff-dwarf/test46-rust-report-0.txt [new file with mode: 0644]
tests/test-diff-dwarf.cc

index 671eab5..d274db9 100644 (file)
@@ -724,8 +724,8 @@ fi
 
 HAS_DW_LANG_Rust=no
 AC_CHECK_DECL([DW_LANG_Rust],
-             [HAS_LANG_Rust=yes],
-             [HAS_LANG_Rust=no],
+             [HAS_DW_LANG_Rust=yes],
+             [HAS_DW_LANG_Rust=no],
              [[#include <dwarf.h>]])
 
 if test x$HAS_DW_LANG_Rust = xyes; then
diff --git a/tests/data/test-diff-dwarf/test46-readme.txt b/tests/data/test-diff-dwarf/test46-readme.txt
new file mode 100644 (file)
index 0000000..c192217
--- /dev/null
@@ -0,0 +1,3 @@
+The test46-rust-libone.so and test46-rust-libtwo.so binaries come from
+the project https://gitlab.gnome.org/federico/abi-rust. The binaries
+there are libone.so and libtwo.so, renamed accordingly here.
diff --git a/tests/data/test-diff-dwarf/test46-rust-libone.so b/tests/data/test-diff-dwarf/test46-rust-libone.so
new file mode 100755 (executable)
index 0000000..8f3a612
Binary files /dev/null and b/tests/data/test-diff-dwarf/test46-rust-libone.so differ
diff --git a/tests/data/test-diff-dwarf/test46-rust-libtwo.so b/tests/data/test-diff-dwarf/test46-rust-libtwo.so
new file mode 100755 (executable)
index 0000000..386635d
Binary files /dev/null and b/tests/data/test-diff-dwarf/test46-rust-libtwo.so differ
diff --git a/tests/data/test-diff-dwarf/test46-rust-report-0.txt b/tests/data/test-diff-dwarf/test46-rust-report-0.txt
new file mode 100644 (file)
index 0000000..87544b6
--- /dev/null
@@ -0,0 +1,18 @@
+Functions changes summary: 0 Removed, 1 Changed, 0 Added function
+Variables changes summary: 0 Removed, 0 Changed, 0 Added variable
+
+1 function with some indirect sub-type change:
+
+  [C]'function one::Foo one::foo(u32)' has some indirect sub-type changes:
+    'function one::Foo one::foo(u32) {foo}' now becomes 'function two::Foo two::foo(u32, u32) {foo}'
+    return type changed:
+      type name changed from 'one::Foo' to 'two::Foo'
+      type size changed from 32 to 64 (in bits)
+      1 data member insertion:
+        'u32 two::Foo::b', at offset 32 (in bits)
+      1 data member change:
+       name of 'one::Foo::a' changed to 'two::Foo::a'
+    parameter 2 of type 'u32' was added
+
+
+
index 7a2699d..c189603 100644 (file)
@@ -344,6 +344,12 @@ InOutSpec in_out_specs[] =
     "data/test-diff-dwarf/test45-anon-dm-change-report-0.txt",
     "output/test-diff-dwarf/test45-anon-dm-change-report-0.txt"
   },
+  {
+    "data/test-diff-dwarf/test46-rust-libone.so",
+    "data/test-diff-dwarf/test46-rust-libtwo.so",
+    "data/test-diff-dwarf/test46-rust-report-0.txt",
+    "output/test-diff-dwarf/test46-rust-report-0.txt"
+  },
   // This should be the last entry
   {NULL, NULL, NULL, NULL}
 };