def test_swift_package()

in project_future.py [0:0]


def test_swift_package(path, swiftc, sandbox_profile,
                       stdout=sys.stdout, stderr=sys.stderr,
                       added_swift_flags=None,
                       incremental=False,
                       override_swift_exec=None):
    """Test a Swift package manager project."""
    swift = os.path.join(os.path.dirname(swiftc), 'swift')
    if not incremental:
        clean_swift_package(path, swiftc, sandbox_profile)
    env = os.environ
    env['SWIFT_EXEC'] = override_swift_exec or swiftc
    command = [swift, 'test', '-C', path, '--verbose']
    if added_swift_flags is not None:
        for flag in added_swift_flags.split():
            command += ["-Xswiftc", flag]
    if (swift_branch not in ['swift-3.0-branch',
                             'swift-3.1-branch']):
        command.insert(2, '--disable-sandbox')
    return common.check_execute(command, timeout=3600,
                                sandbox_profile=sandbox_profile,
                                stdout=stdout, stderr=stderr,
                                env=env)