Most standards produce test suites to demonstrate the features of the standard. This is also very useful to test implementations. GPAC also has a (very limited) test suite to test that the code does not regress. However, when the tests need to be clicked on or when there is animation, the validation of a test may get quite complex.
There are several ways to solve this problem. Erik Dahlström from Opera told me that they use additional JavaScript with specific APIs to do their regression testing. This is interesting but I’m concerned by the time it takes to author this Javascript. So I thought about another way.
Within GPAC, I’ve implemented a small plugin which enables two things:
- to play a test, record the interactions (in an XML file) and take PNG snapshots upon specific events;
- and then to replay the content, reproduce the interactions and compare the snapshots to indicate if the result is valid or not.
A playlist of test sequences can then be created and the validation can be automatic. It doesn’t take much time to record the interactions, what I called the validation script.
You should see this soon on GPAC SVN.