Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Gepetto
example-robot-data
Commits
ad8b52a1
Commit
ad8b52a1
authored
Sep 16, 2019
by
Carlos Mastalli
Browse files
[unit-test] Fixed issue with multiple unit-tests + added solo unit-test
parent
e8435a7e
Changes
1
Hide whitespace changes
Inline
Side-by-side
unittest/test_load.py
View file @
ad8b52a1
#!/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
())
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment