Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add test for printing all items in wee_alloc diff #268

Merged
merged 1 commit into from
Mar 14, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions twiggy/tests/all/diff_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,16 @@ test!(
"5"
);

// TODO: Update this test once `--all` flag is added.
test!(
diff_wee_alloc_all,
"diff",
"./fixtures/wee_alloc.wasm",
"./fixtures/wee_alloc.2.wasm",
"-n",
"100"
);

test!(
diff_wee_alloc_json,
"diff",
Expand Down
43 changes: 43 additions & 0 deletions twiggy/tests/all/expectations/diff_wee_alloc_all
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
Delta Bytes │ Item
─────────────┼─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
-1034 ┊ data[3]
-593 ┊ "function names" subsection
+395 ┊ wee_alloc::alloc_first_fit::he2a4ddf96981c0ce
+243 ┊ goodbye
-225 ┊ wee_alloc::alloc_first_fit::h9a72de3af77ef93f
-152 ┊ wee_alloc::alloc_with_refill::hb32c1bbce9ebda8e
+145 ┊ <wee_alloc::neighbors::Neighbors<'a, T>>::remove::hc9e5d4284e8233b8
-136 ┊ <wee_alloc::size_classes::SizeClassAllocPolicy<'a> as wee_alloc::AllocPolicy>::new_cell_for_free_list::h3987e3054b8224e6
-76 ┊ <wee_alloc::LargeAllocPolicy as wee_alloc::AllocPolicy>::new_cell_for_free_list::h8f071b7bce0301ba
-25 ┊ data[1]
-25 ┊ data[2]
+15 ┊ hello
+15 ┊ import env::rust_oom
-12 ┊ elem[0]
+10 ┊ custom section 'linking' headers
+8 ┊ global[0]
-8 ┊ type[4]: (i32, i32, i32, i32, i32) -> nil
-6 ┊ <wee_alloc::LargeAllocPolicy as wee_alloc::AllocPolicy>::min_cell_size::hc7cee2a550987099
+6 ┊ alloc::alloc::oom::h45ae3f22a516fb04
-6 ┊ type[0]: (i32, i32, i32) -> nil
-6 ┊ type[1]: (i32, i32) -> i32
-5 ┊ <wee_alloc::size_classes::SizeClassAllocPolicy<'a> as wee_alloc::AllocPolicy>::min_cell_size::h6f746be886573355
+5 ┊ type[1]: (i32) -> i32
-4 ┊ __wasm_nullptr
+4 ┊ type[0]: () -> i32
-4 ┊ type[5]: () -> i32
-3 ┊ core::ptr::drop_in_place::h4e5cdfd7b9310648.18
-3 ┊ core::ptr::drop_in_place::h8e9fdc2437d43666
+3 ┊ custom section 'linking'
-3 ┊ element section headers
+3 ┊ global section headers
+3 ┊ import section headers
+2 ┊ data[0]
-1 ┊ data section headers
-1 ┊ func[10]
-1 ┊ func[5]
-1 ┊ func[6]
-1 ┊ func[7]
-1 ┊ func[8]
-1 ┊ func[9]
-1476 ┊ Σ [40 Total Rows]