-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
New bazel macro to test run installed drake.
`install_test()` is a wrapper macro that creates a Python script that is run during the testing phase. The Python script installs `drake` and runs the targets that are listed in `install_tests` in install rules. The Python script that is created will allow to test multiple targets in the install tree without having to install drake multiple times. `install_test()` should be called only once, in `//:*`. All the install tests that have been created in all the `install()` commands in the source tree will be integrated in the Python script that is generated. The targets can either be executables that are installed, or any executable or scripts that is designed to test drake features in the install tree. The Python install_test_helper file (`tools/install/install_test_helper.py`) has been improved to easily create Python scripts that run commands from the install directory. This is convenient when trying to test an executable in the install tree that is run with parameters, or an executable that needs to be killed because it never stops running.
- Loading branch information
Francois Budin
committed
Mar 2, 2018
1 parent
c759a0b
commit a7ba439
Showing
21 changed files
with
493 additions
and
222 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
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
30 changes: 10 additions & 20 deletions
30
bindings/pydrake/test/common_install_test.py
100644 → 100755
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
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
25 changes: 25 additions & 0 deletions
25
examples/kuka_iiwa_arm/test/iiwa_wsg_simulation_installed_test.py
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,25 @@ | ||
#!/usr/bin/env python | ||
|
||
import os | ||
import shutil | ||
import unittest | ||
import sys | ||
import install_test_helper | ||
|
||
|
||
class TestIiwaWsgSimulation(unittest.TestCase): | ||
def test_install(self): | ||
# Get install directory. | ||
install_dir = install_test_helper.get_install_dir() | ||
# Make sure the simulation can run without error. We set cwd="/" to | ||
# defeat the "search in parent folders" heuristic, so that the "use | ||
# libdrake.so relative paths" must be successful. | ||
simulation = os.path.join( | ||
install_dir, | ||
"share/drake/examples/kuka_iiwa_arm/iiwa_wsg_simulation") | ||
self.assertTrue(os.path.exists(simulation), "Can't find " + simulation) | ||
install_test_helper.check_call([simulation, "--simulation_sec=0.01"]) | ||
|
||
|
||
if __name__ == '__main__': | ||
unittest.main() |
14 changes: 14 additions & 0 deletions
14
examples/kuka_iiwa_arm/test/kuka_plan_runner_installed_test.py
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,14 @@ | ||
#!/usr/bin/env python | ||
|
||
import unittest | ||
import install_test_helper | ||
|
||
|
||
class TestKukaSimulation(unittest.TestCase): | ||
def test_install(self): | ||
install_test_helper.run_and_kill( | ||
['share/drake/examples/kuka_iiwa_arm/kuka_plan_runner']) | ||
|
||
|
||
if __name__ == '__main__': | ||
unittest.main() |
Oops, something went wrong.