-
Notifications
You must be signed in to change notification settings - Fork 99
Revision Control Implementation
tnvme’s command line allows specifying which revision the compliance suite will target. Specifically, option --rev will be used. The command line is parsed and converted to an enumeration value of type SpecRev. In order to determine if tnvme supports a specific NVMe release it must therefore be listed within this enumeration. tnvme then constructs all group objects and continues to pass the revision information to the appropriate group(s). The group objects are to determine which tests are appropriate to execute against the requested revision. The group makes available only those tests which conform to the stated revision. This implies that the ability to request test descriptions and to execute tests must be from within this filtered subset of tests.
Each group object can be thought of as a container which contains test objects. As every group is instantiated, during tnvme initialization, the revision information causes the group object’s constructor to instantiate only those tests which target the requested revision. Tests which do not conform, are not instantiated, and thus in no way can affect the testing. We are guaranteeing that all tests which are instantiated are born on purpose. The most important task of a group is done at construction time.
It might be important to understand that a particular test case can be instantiated in multiple different targeted revisions. This will occur, if and only if, the test case is 100% compatible with the different releases of the NVMe specification. In other words, the source code for a particular group object may instantiate the identical test which executes against numerous requested revisions. If the test case source code is only 99.99% compatible, then a child may be derived from the source and be saved under a new name to indicate the new targeted specification. The group object will instantiate this new child test object only when the requested revision is identical to the coded one. Incidentally, the new child test object will only have to change that part of the parent object which doesn’t apply, thus maximizing code reuse by taking advantage of polymorphism and inheritance.