This is an archive of the discontinued LLVM Phabricator instance.

[New PM] adding unit tests for PassInstrumentation
AbandonedPublic

Authored by fedor.sergeev on Sep 12 2018, 3:38 AM.

Details

Summary

Register mock instrumentation with PassBuilder and make a run
of pass/analysis checking that corresponding instrumentation calls
are done by pass managers.

(Since I'm new to these unittests) after the overall concept
(as well as details) of my testing approach are confirmed I'm going
to split this change in pieces and attach these pieces to the appropriate
PassInstrumentation patches in my series.

Diff Detail

Event Timeline

fedor.sergeev created this revision.Sep 12 2018, 3:38 AM
fedor.sergeev added inline comments.Sep 12 2018, 3:45 AM
unittests/IR/PassBuilderCallbacksTest.cpp
269–275

I'm particularly worried about having to use generic EXPECT_CALLs to essentially ignore majority of PassInstrumentation calls. And then InstrumentedPasses subtests perform sequenced checking for a selected subset only.
It does not look very pretty, but it appeared to be the only way to not dive deep into the details of each and every pass manager on each test.

This looks good! I dislike the AnyNumber() expecations you highlighted above, but I see that it's unavoidable without either repeating a lot of the test logic again, or without waiting for something like D39678 to happen.

fedor.sergeev abandoned this revision.Sep 14 2018, 9:30 AM

These tests were split and added to the corresponding PassInstrumentation.