-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[pr2eus/test/robot-init-test.*, pr2eus/CMakeLists.txt] Add robot-init…
… function rostest. Add rostest execution for it in CMakeLists.txt.
- Loading branch information
Showing
3 changed files
with
39 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
#!/bin/env roseus | ||
|
||
;; robot-init test | ||
|
||
(require :unittest "lib/llib/unittest.l") | ||
|
||
(load "package://pr2eus/robot-interface.l") | ||
(ros::roseus "test_robot_init") | ||
|
||
(init-unit-test) | ||
|
||
;;(deftest test-robot-init-without-param-and-argument () | ||
;; (assert (not (robot-init)) "This should invoke error.")) | ||
|
||
(deftest test-robot-init-with-argument () | ||
(assert (progn | ||
(robot-init "pr2") | ||
(and *ri* *pr2*)) | ||
"This should return pr2 and ri.") | ||
) | ||
|
||
(deftest test-robot-init-without-argument-with-param () | ||
(makunbound '*ri*) | ||
(makunbound '*pr2*) | ||
(ros::set-param "/robot/type" "pr2") | ||
(assert (progn | ||
(robot-init) | ||
(and *ri* *pr2*)) | ||
"This should return pr2 and ri.") | ||
) | ||
|
||
(run-all-tests) | ||
(exit) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
<launch> | ||
<test test-name="robot_init_test_node" pkg="roseus" type="roseus" | ||
args="$(find pr2eus)/test/robot-init-test.l" time-limit="600" /> | ||
</launch> |