schwern/test-more — Issue #198: Remove storage of events and results from History
Author: schwern
Created: 2011-11-14 02:45:08+00:00
State: open
Labels: DO IT, Gardening, History, Test-Builder2

Ideally, TB2 should consume O(1) memory no matter how many results are run. This cannot be true if History stores events and results. To satisfy this, History keeps statistics and there is the TB2::NoHistory subclass which does not store events.

Unfortunately, when something is passed a "History" object, it might be NoHistory and thus some methods might not be safe to use. This is awkward. The relationship should be inverted. TB2::History should only keep statistics. A subclass or role or even separate watcher should store roles and events.

Change Test::Builder2::History to only store event statistics. Add whatever methods are necessary to make History useful to all its current users.

Write a role which stores events and results. Make sure there's a hook in `History->accept_event` to store the event if `$self` does the role.