Commit ad8b52a1 authored by Carlos Mastalli's avatar Carlos Mastalli
Browse files

[unit-test] Fixed issue with multiple unit-tests + added solo unit-test

parent e8435a7e
#!/usr/bin/env python2
import sys
import unittest
import example_robot_data
......@@ -21,6 +22,18 @@ class RobotTestCase(unittest.TestCase):
self.assertTrue(hasattr(self.ROBOT, "q0"), "It doesn't have q0")
class HyQTest(RobotTestCase):
RobotTestCase.ROBOT = example_robot_data.loadHyQ()
RobotTestCase.NQ = 19
RobotTestCase.NV = 18
class TalosTest(RobotTestCase):
RobotTestCase.ROBOT = example_robot_data.loadTalos()
RobotTestCase.NQ = 39
RobotTestCase.NV = 38
class TalosArmTest(RobotTestCase):
RobotTestCase.ROBOT = example_robot_data.loadTalosArm()
RobotTestCase.NQ = 7
......@@ -33,20 +46,26 @@ class TalosArmFloatingTest(RobotTestCase):
RobotTestCase.NV = 13
class TalosTest(RobotTestCase):
RobotTestCase.ROBOT = example_robot_data.loadTalos()
RobotTestCase.NQ = 39
RobotTestCase.NV = 38
class TalosLegsTest(RobotTestCase):
RobotTestCase.ROBOT = example_robot_data.loadTalosLegs()
RobotTestCase.NQ = 19
RobotTestCase.NV = 18
class HyQTest(RobotTestCase):
RobotTestCase.ROBOT = example_robot_data.loadHyQ()
class ICubTest(RobotTestCase):
RobotTestCase.ROBOT = example_robot_data.loadICub(reduced=False)
RobotTestCase.NQ = 39
RobotTestCase.NV = 38
class SoloTest(RobotTestCase):
RobotTestCase.ROBOT = example_robot_data.loadSolo()
RobotTestCase.NQ = 15
RobotTestCase.NV = 14
class Solo12Test(RobotTestCase):
RobotTestCase.ROBOT = example_robot_data.loadSolo(False)
RobotTestCase.NQ = 19
RobotTestCase.NV = 18
......@@ -63,11 +82,17 @@ class TiagoNoHandTest(RobotTestCase):
RobotTestCase.NV = 12
class ICubTest(RobotTestCase):
RobotTestCase.ROBOT = example_robot_data.loadICub(reduced=False)
RobotTestCase.NQ = 39
RobotTestCase.NV = 38
if __name__ == '__main__':
unittest.main()
test_classes_to_run = [
HyQTest, TalosTest, TalosArmTest, TalosArmFloatingTest, TalosLegsTest, ICubTest, SoloTest, Solo12Test,
TiagoTest, TiagoNoHandTest
]
loader = unittest.TestLoader()
suites_list = []
for test_class in test_classes_to_run:
suite = loader.loadTestsFromTestCase(test_class)
suites_list.append(suite)
big_suite = unittest.TestSuite(suites_list)
runner = unittest.TextTestRunner()
results = runner.run(big_suite)
sys.exit(not results.wasSuccessful())
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment