Closed Bug 1078979 Opened 7 years ago Closed 7 years ago

Add more testing of dmd.py

Categories

(Core :: DMD, defect)

x86_64
Linux
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla35

People

(Reporter: n.nethercote, Assigned: n.nethercote)

References

Details

Attachments

(1 file)

Bug 1073312 will add end-to-end testing of DMD, which includes some testing of dmd.py. But I want to add some additional testing of dmd.py's options using hand-written JSON input files.
Blocks: 1078981
Brace yourself: this may just be the most exciting patch you'll ever review.

The patch adds more testing of dmd.py, using hand-written JSON files instead
of actual DMD output. This gives extra control that allows fine-tuned testing
of dmd.py's various options.

Specifically:

- It renames the existing tests, giving them more descriptive names than 1, 2,
  3, 4.

- It adds '???' to the list of patterns used by --ignore-alloc-fns. Note that
  it will not match just anywhere in a stack trace, but only as part of a
  sequence of allocator functions at the start of a trace. This is so the
  following real sequence will match from #01 to #05:

  #01: replace_memalign (DMD.cpp:1181)
  #02: replace_posix_memalign (replace_malloc.h:120)
  #03: ??? (/lib/x86_64-linux-gnu/libglib-2.0.so.0)
  #04: g_slice_alloc (/lib/x86_64-linux-gnu/libglib-2.0.so.0)
  #05: g_slice_alloc0 (/lib/x86_64-linux-gnu/libglib-2.0.so.0)
  #06: g_type_create_instance (/usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0)

- It adds a bunch of .json and .expected.txt files for the new tests.

- It tweaks test_dmd.js to handle the existing "full" tests and the new
  "script" tests.
Attachment #8502838 - Flags: review?(erahm)
Comment on attachment 8502838 [details] [diff] [review]
Add more testing of dmd.py

Review of attachment 8502838 [details] [diff] [review]:
-----------------------------------------------------------------

r=me with one small tweak to the alloc function test.

::: memory/replace/dmd/dmd.py
@@ +21,5 @@
>  # The DMD output version this script handles.
>  outputVersion = 1
>  
>  # If --ignore-alloc-fns is specified, stack frames containing functions that
> +# match these strings will be removed from the start of stack traces.

min: This could be expanded to explain we just trim alloc functions from the top of the stack

::: memory/replace/dmd/test/script-ignore-alloc-fns.json
@@ +35,5 @@
> +  "DB": "#00: replace_posix_memalign (replace_malloc.h:120)",
> +  "DC": "#00: ??? (/lib/x86_64-linux-gnu/libglib-2.0.so.0)",
> +  "DD": "#00: g_slice_alloc (/lib/x86_64-linux-gnu/libglib-2.0.so.0)",
> +  "DE": "#00: g_slice_alloc0 (/lib/x86_64-linux-gnu/libglib-2.0.so.0)",
> +  "DF": "#00: g_type_create_instance (/usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0)"

med: Already discussed this on IRC, can we add a test where an alloc function is in the middle of the stack?
Attachment #8502838 - Flags: review?(erahm) → review+
https://hg.mozilla.org/mozilla-central/rev/1c7a61385d17
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla35
Flags: qe-verify-
You need to log in before you can comment on or make changes to this bug.