mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-03-05 03:11:16 +00:00
validate:launcher: Fix wrong test number with -j option
When '-j n' option is given, first n tests print test number 0.
This is caused by test_num part of 919db98605
.
https://bugzilla.gnome.org/show_bug.cgi?id=747006
This commit is contained in:
parent
ba6d209b3f
commit
4c7ec6b8b1
1 changed files with 8 additions and 7 deletions
|
@ -749,7 +749,7 @@ class TestsManager(Loggable):
|
||||||
self.queue = Queue.Queue()
|
self.queue = Queue.Queue()
|
||||||
self.jobs = []
|
self.jobs = []
|
||||||
self.total_num_tests = 0
|
self.total_num_tests = 0
|
||||||
self.test_num = 1
|
self.starting_test_num = 0
|
||||||
self.check_testslist = True
|
self.check_testslist = True
|
||||||
self.all_tests = None
|
self.all_tests = None
|
||||||
|
|
||||||
|
@ -890,7 +890,7 @@ class TestsManager(Loggable):
|
||||||
|
|
||||||
def run_tests(self, starting_test_num, total_num_tests):
|
def run_tests(self, starting_test_num, total_num_tests):
|
||||||
self.total_num_tests = total_num_tests
|
self.total_num_tests = total_num_tests
|
||||||
self.test_num = starting_test_num
|
self.starting_test_num = starting_test_num
|
||||||
|
|
||||||
num_jobs = min(self.options.num_jobs, len(self.tests))
|
num_jobs = min(self.options.num_jobs, len(self.tests))
|
||||||
tests_left = list(self.tests)
|
tests_left = list(self.tests)
|
||||||
|
@ -906,18 +906,18 @@ class TestsManager(Loggable):
|
||||||
jobs_running -= 1
|
jobs_running -= 1
|
||||||
self.print_test_num(test)
|
self.print_test_num(test)
|
||||||
res = test.test_end()
|
res = test.test_end()
|
||||||
self.test_num += 1
|
|
||||||
self.reporter.after_test(test)
|
self.reporter.after_test(test)
|
||||||
if res != Result.PASSED and (self.options.forever or
|
if res != Result.PASSED and (self.options.forever or
|
||||||
self.options.fatal_error):
|
self.options.fatal_error):
|
||||||
return test.result, self.test_num
|
return test.result
|
||||||
if self.start_new_job(tests_left):
|
if self.start_new_job(tests_left):
|
||||||
jobs_running += 1
|
jobs_running += 1
|
||||||
|
|
||||||
return Result.PASSED, self.test_num
|
return Result.PASSED
|
||||||
|
|
||||||
def print_test_num(self, test):
|
def print_test_num(self, test):
|
||||||
sys.stdout.write("[%d / %d] " % (self.test_num, self.total_num_tests))
|
cur_test_num = self.starting_test_num + self.tests.index(test) + 1
|
||||||
|
sys.stdout.write("[%d / %d] " % (cur_test_num, self.total_num_tests))
|
||||||
|
|
||||||
def clean_tests(self):
|
def clean_tests(self):
|
||||||
for test in self.tests:
|
for test in self.tests:
|
||||||
|
@ -1169,7 +1169,8 @@ class _TestsLauncher(Loggable):
|
||||||
|
|
||||||
self.reporter.init_timer()
|
self.reporter.init_timer()
|
||||||
for tester in self.testers:
|
for tester in self.testers:
|
||||||
res, cur_test_num = tester.run_tests(cur_test_num, total_num_tests)
|
res = tester.run_tests(cur_test_num, total_num_tests)
|
||||||
|
cur_test_num += len(tester.list_tests())
|
||||||
if res != Result.PASSED and (self.options.forever or
|
if res != Result.PASSED and (self.options.forever or
|
||||||
self.options.fatal_error):
|
self.options.fatal_error):
|
||||||
return False
|
return False
|
||||||
|
|
Loading…
Reference in a new issue