Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ def module_init():

prepend_path(os.path.join(os.environ['TEST_RUN_DIR'], 'lib/luatest/bin'))

TarantoolServer.find_exe(args.builddir)
TarantoolServer.find_exe(args.builddir, executable=args.executable)
UnittestServer.find_exe(args.builddir)
AppServer.find_exe(args.builddir)
LuatestServer.find_exe(args.builddir)
Expand Down
11 changes: 11 additions & 0 deletions lib/options.py
Original file line number Diff line number Diff line change
Expand Up @@ -493,6 +493,17 @@ def __init__(self):
$ . <(./test/test-run.py --env)
"""))

parser.add_argument(
'--executable',
dest='executable',
default=None,
help=format_help(
"""
Set a custom path to the Tarantool executable.

Useful when Tarantool binary is not in $BUILDDIR and $PATH.
"""))

# XXX: We can use parser.parse_intermixed_args() on
# Python 3.7 to understand commands like
# ./test-run.py foo --exclude bar baz
Expand Down
10 changes: 3 additions & 7 deletions lib/tarantool_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -694,19 +694,15 @@ def __init__(self, _ini=None, test_suite=None):
self.current_test = caller_globals['test_run_current_test']

@classmethod
def find_exe(cls, builddir, silent=True):
def find_exe(cls, builddir, silent=True, executable=None):
cls.builddir = os.path.abspath(builddir)
builddir = os.path.join(builddir, "src")
path = builddir + os.pathsep + os.environ["PATH"]
color_log("Looking for server binary in ", schema='serv_text')
color_log(path + ' ...\n', schema='path')
for _dir in path.split(os.pathsep):
exe = os.path.join(_dir, cls.default_tarantool["bin"])
ctl_dir = _dir
# check local tarantoolctl source
if _dir == builddir:
ctl_dir = os.path.join(_dir, '../extra/dist')

exe = executable or os.path.join(_dir, cls.default_tarantool["bin"])
ctl_dir = cls.TEST_RUN_DIR
ctl = os.path.join(ctl_dir, cls.default_tarantool['ctl'])
need_lua_path = False
if os.path.isdir(ctl) or not os.access(ctl, os.X_OK):
Expand Down
Loading