Skip to content

Commit b161e64

Browse files
committed
Print message when no tests are defined.
1 parent 9044773 commit b161e64

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

meson_test.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,13 +134,16 @@ def run_tests(options, datafilename):
134134
jsonlogfile = open(jsonlogfilename, 'w')
135135
logfile.write('Log of Meson test suite run on %s.\n\n' % datetime.datetime.now().isoformat())
136136
tests = pickle.load(open(datafilename, 'rb'))
137+
if len(tests) == 0:
138+
print('No tests defined.')
139+
return
137140
numlen = len('%d' % len(tests))
138141
varname = 'MESON_TESTTHREADS'
139142
if varname in os.environ:
140143
try:
141144
num_workers = int(os.environ[varname])
142145
except ValueError:
143-
write_log('Invalid value in %s, using 1 thread.' % varname)
146+
print('Invalid value in %s, using 1 thread.' % varname)
144147
num_workers = 1
145148
else:
146149
num_workers = multiprocessing.cpu_count()

0 commit comments

Comments
 (0)