示例#1
0
    def test_install(self):
        # Fail (on purpose) if not given exactly one command line argument.
        self.assertEqual(len(sys.argv), 2)
        with open(sys.argv[1], 'r') as f:
            lines = f.readlines()

        # Install into bazel read-only temporary directory. The temporary
        # directory does not need to be removed as bazel tests are run in a
        # scratch space.
        install_test_helper.install()
        installation_folder = install_test_helper.get_install_dir()
        self.assertTrue(os.path.isdir(installation_folder))

        # Verify install directory content.
        content = set(os.listdir(installation_folder))
        self.assertSetEqual(set(['bin', 'include', 'lib', 'share']), content)

        # Our launched processes should be independent, not inherit their
        # runfiles from the install_test.py runner.
        cmd_env = dict(os.environ)
        for key in ["RUNFILES_MANIFEST_FILE", "RUNFILES_DIR", "TEST_SRCDIR"]:
            if key in cmd_env:
                del cmd_env[key]

        # Execute the install actions.
        for cmd in lines:
            cmd = cmd.strip()
            print("+ {}".format(cmd))
            install_test_helper.check_call(
                [os.path.join(os.getcwd(), cmd)],
                env=cmd_env)
示例#2
0
 def test_install(self):
     # Get install directory.
     install_dir = install_test_helper.get_install_dir()
     executable_folder = os.path.join(install_dir, "bin")
     install_test_helper.check_call(
         [os.path.join(executable_folder, "lcm-gen"), "--help"],
         )
示例#3
0
 def test_install(self):
     # Get install directory
     install_dir = install_test_helper.get_install_dir()
     # Make sure the simulation can run without error.
     simulation = os.path.join(
         install_dir,
         "share/drake/examples/kuka_iiwa_arm/kuka_simulation")
     self.assertTrue(os.path.exists(simulation), "Can't find " + simulation)
     install_test_helper.check_call([simulation, "--simulation_sec=0.01"])
示例#4
0
    def _run_one_command(self, test_command):
        # Our launched processes should be independent, not inherit their
        # runfiles from the install_test.py runner.
        env = dict(os.environ)
        for key in ["RUNFILES_MANIFEST_FILE", "RUNFILES_DIR", "TEST_SRCDIR"]:
            if key in env:
                del env[key]

        # Execute the test_command.
        print("+ {}".format(test_command), file=sys.stderr)
        install_test_helper.check_call(
            [os.path.join(os.getcwd(), test_command)], env=env)
示例#5
0
 def test_install(self):
     # Get install directory.
     install_dir = install_test_helper.get_install_dir()
     # Override PYTHONPATH to only use the installed `pydrake` module.
     env_python_path = "PYTHONPATH"
     tool_env = dict(os.environ)
     tool_env[env_python_path] = \
         install_test_helper.get_python_site_packages_dir(install_dir)
     # Ensure we can import all user-visible modules.
     script = "import pydrake.all"
     install_test_helper.check_call(
         [install_test_helper.get_python_executable(), "-c", script],
         env=tool_env)
示例#6
0
 def test_install(self):
     # Get install directory.
     install_dir = install_test_helper.get_install_dir()
     # Override PYTHONPATH to only use the installed `pydrake` module.
     env_python_path = "PYTHONPATH"
     tool_env = dict(os.environ)
     tool_env[env_python_path] = \
         install_test_helper.get_python_site_packages_dir(install_dir)
     # Ensure we can import all user-visible modules.
     script = "import pydrake.all"
     install_test_helper.check_call(
         [install_test_helper.get_python_executable(), "-c", script],
         env=tool_env
     )
示例#7
0
    def test_install(self):
        # Fail (on purpose) if not given exactly one command line argument.
        self.assertEqual(len(sys.argv), 2)
        with open(sys.argv[1], 'r') as f:
            lines = f.readlines()

        # Install into bazel read-only temporary directory. The temporary
        # directory does not need to be removed as bazel tests are run in a
        # scratch space.
        install_test_helper.install()
        installation_folder = install_test_helper.get_install_dir()
        self.assertTrue(os.path.isdir(installation_folder))

        # Verify install directory content.
        content = set(os.listdir(installation_folder))
        self.assertSetEqual(set(['bin', 'include', 'lib', 'share']), content)

        # Execute the install actions.
        for cmd in lines:
            cmd = cmd.strip()
            print("+ {}".format(cmd))
            install_test_helper.check_call([os.path.join(os.getcwd(), cmd)])
示例#8
0
 def test_install(self):
     # Get install directory.
     install_dir = install_test_helper.get_install_dir()
     executable_folder = os.path.join(install_dir, "bin")
     install_test_helper.check_call(
         [os.path.join(executable_folder, "lcm-gen"), "--help"], )
 def test_check_call(self):
     python = install_test_helper.get_python_executable()
     install_test_helper.check_call([python, "--help"])
示例#10
0
import os
import sys
import install_test_helper

# Install into bazel read-only temporary directory. The temporary
# directory does not need to be removed as bazel tests are run in a
# scratch space.
install_test_helper.install()
installation_folder = install_test_helper.get_install_dir()
assert os.path.isdir(installation_folder)
# Verify install directory content.
content = os.listdir(installation_folder)
assert set(['bin', 'include', 'lib', 'share']) == set(content)
# Will fail (on purpose) if not exactly one command line argument given.
assert len(sys.argv) == 2

with open(sys.argv[1], "r") as f:
    lines = f.readlines()

# Execute the install actions.
for cmd in lines:
    cmd = cmd.strip()
    install_test_helper.check_call(os.path.join(os.getcwd(), cmd))
 def test_check_call(self):
     python = install_test_helper.get_python_executable()
     install_test_helper.check_call([python, "--help"])