@@ -41,14 +41,17 @@ def execute(self, server):
41
41
"""
42
42
server .current_test = self
43
43
script = os .path .join (os .path .basename (server .testdir ), self .name )
44
- command = ['luatest' , '-c' , '--verbose' , script , '--output' , 'tap' ]
44
+
45
+ # Disable stdout buffering.
46
+ command = [server .binary , '-e' , "io.stdout:setvbuf('no')" ]
47
+ # Add luatest as the script.
48
+ command .extend ([server .luatest ])
49
+ # Add luatest command-line options.
50
+ command .extend (['-c' , '--verbose' , script , '--output' , 'tap' ])
45
51
if Options ().args .pattern :
46
52
for p in Options ().args .pattern :
47
53
command .extend (['--pattern' , p ])
48
54
49
- # Tarantool's build directory is added to PATH in
50
- # TarantoolServer.find_exe().
51
- #
52
55
# We start luatest from the project source directory, it
53
56
# is the usual way to use luatest.
54
57
#
@@ -110,14 +113,15 @@ def find_exe(cls, builddir):
110
113
cls .binary = TarantoolServer .binary
111
114
cls .debug = bool (re .findall (r'^Target:.*-Debug$' , str (cls .version ()),
112
115
re .M ))
116
+ cls .luatest = os .environ ['TEST_RUN_DIR' ] + '/lib/luatest/bin/luatest'
113
117
114
118
@classmethod
115
119
def verify_luatest_exe (cls ):
116
120
"""Verify that luatest executable is available."""
117
121
try :
118
122
# Just check that the command returns zero exit code.
119
123
with open (os .devnull , 'w' ) as devnull :
120
- returncode = Popen ([' luatest' , '--version' ],
124
+ returncode = Popen ([cls . luatest , '--version' ],
121
125
stdout = devnull ,
122
126
stderr = devnull ).wait ()
123
127
if returncode != 0 :
0 commit comments