ejrgilbert / whamm

Debugging WebAssembly? Put some Whamm! on it.
https://ejrgilbert.github.io/whamm/
16 stars 3 forks source link

Leverage SpecTests for Testing #145

Open ejrgilbert opened 3 months ago

ejrgilbert commented 3 months ago

To have breadth with testing instrumentation, we should integrate with the spectest wast files and have the following logic:

  1. Load wast
  2. Break out each test case (module(s) and assertion(s))
  3. foreach (supported_event, non_alt_mode): Instrument the module(s) with instrumentation that has no side effects, but exercises all logic
    • Add new global(s)
    • Add new local function(s)
    • Instrument some target with logic that calls the function
    • Write to new wast file, one test case per file
    • Run on configured interpreters (all assertions should still pass)

We will also need to have some mechanism to ensure that the instrumented wast actually had some instrumentation logic applied (should have matched and injected at least once).