VirtualBox

Ignore:
Timestamp:
Jan 30, 2018 6:20:29 PM (7 years ago)
Author:
vboxsync
Message:

ValidationKit: For API tests move some redundant object construction to the test constructor, saving a few lines, and what's most important avoid a variable in global scope which pylint doesn't like.

Location:
trunk/src/VBox/ValidationKit/tests/api
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/ValidationKit/tests/api/tdApi1.py

    r70813 r70816  
    5050    """
    5151
    52     def __init__(self, aoSubTestDrivers = None):
     52    def __init__(self, aSubTestDrivers = None):
    5353        vbox.TestDriver.__init__(self)
    5454        self.asRsrcs            = None
     55        for classSubTestDrivers in aSubTestDrivers:
     56            self.addSubTestDriver(classSubTestDrivers(self))
    5557
    5658    #
     
    7880if __name__ == '__main__':
    7981    sys.path.append(os.path.dirname(os.path.abspath(__file__)))
    80     oTD = tdApi1()
    8182    from tdPython1 import SubTstDrvPython1
    82     oTD.addSubTestDriver(SubTstDrvPython1(oTD))
    8383    from tdAppliance1 import SubTstDrvAppliance1
    84     oTD.addSubTestDriver(SubTstDrvAppliance1(oTD))
    8584    from tdMoveMedium1 import SubTstDrvMoveMedium1
    86     oTD.addSubTestDriver(SubTstDrvMoveMedium1(oTD))
    8785    from tdTreeDepth1 import SubTstDrvTreeDepth1
    88     oTD.addSubTestDriver(SubTstDrvTreeDepth1(oTD))
    89     sys.exit(oTD.main(sys.argv))
     86    sys.exit(tdApi1([SubTstDrvPython1, SubTstDrvAppliance1, SubTstDrvMoveMedium1, SubTstDrvTreeDepth1]).main(sys.argv))
    9087
  • trunk/src/VBox/ValidationKit/tests/api/tdAppliance1.py

    r70813 r70816  
    202202    sys.path.append(os.path.dirname(os.path.abspath(__file__)))
    203203    from tdApi1 import tdApi1
    204     oTD = tdApi1()
    205     oTD.addSubTestDriver(SubTstDrvAppliance1(oTD))
    206     sys.exit(oTD.main(sys.argv))
    207 
     204    sys.exit(tdApi1([SubTstDrvAppliance1]).main(sys.argv))
     205
  • trunk/src/VBox/ValidationKit/tests/api/tdMoveMedium1.py

    r70813 r70816  
    163163    sys.path.append(os.path.dirname(os.path.abspath(__file__)))
    164164    from tdApi1 import tdApi1
    165     oTD = tdApi1()
    166     oTD.addSubTestDriver(SubTstDrvMoveMedium1(oTD))
    167     sys.exit(oTD.main(sys.argv))
     165    sys.exit(tdApi1([SubTstDrvMoveMedium1]).main(sys.argv))
    168166
  • trunk/src/VBox/ValidationKit/tests/api/tdPython1.py

    r70813 r70816  
    208208    sys.path.append(os.path.dirname(os.path.abspath(__file__)))
    209209    from tdApi1 import tdApi1
    210     oTD = tdApi1()
    211     oTD.addSubTestDriver(SubTstDrvPython1(oTD))
    212     sys.exit(oTD.main(sys.argv))
    213 
     210    sys.exit(tdApi1([SubTstDrvPython1]).main(sys.argv))
     211
  • trunk/src/VBox/ValidationKit/tests/api/tdTreeDepth1.py

    r70813 r70816  
    148148    sys.path.append(os.path.dirname(os.path.abspath(__file__)))
    149149    from tdApi1 import tdApi1
    150     oTD = tdApi1()
    151     oTD.addSubTestDriver(SubTstDrvTreeDepth1(oTD))
    152     sys.exit(oTD.main(sys.argv))
     150    sys.exit(tdApi1([SubTstDrvTreeDepth1]).main(sys.argv))
    153151
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette