mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-31 11:32:38 +00:00
validate:launcher: Print the number of the test being run
This commit is contained in:
parent
6104ed184f
commit
f1851235d5
3 changed files with 29 additions and 11 deletions
|
@ -203,6 +203,9 @@ class GESTestsManager(TestsManager):
|
|||
pass
|
||||
|
||||
def list_tests(self):
|
||||
if self.tests:
|
||||
return self.tests
|
||||
|
||||
projects = list()
|
||||
if not self.args:
|
||||
path = self.options.projects_paths
|
||||
|
@ -217,7 +220,6 @@ class GESTestsManager(TestsManager):
|
|||
projects.append(proj)
|
||||
else:
|
||||
projects.append(utils.path2url(proj))
|
||||
|
||||
SCENARIOS = ["play_15s",
|
||||
"seek_forward",
|
||||
"seek_backward",
|
||||
|
@ -245,3 +247,5 @@ class GESTestsManager(TestsManager):
|
|||
self.reporter, proj,
|
||||
combination=comb)
|
||||
)
|
||||
|
||||
return self.tests
|
||||
|
|
|
@ -290,6 +290,9 @@ class GstValidateManager(TestsManager, Loggable):
|
|||
return False
|
||||
|
||||
def list_tests(self):
|
||||
if self.tests:
|
||||
return self.tests
|
||||
|
||||
for test_pipeline in G_V_PLAYBACK_TESTS:
|
||||
self._add_playback_test(test_pipeline)
|
||||
|
||||
|
|
|
@ -197,6 +197,7 @@ class Test(Loggable):
|
|||
message += "\n - %s" % log
|
||||
|
||||
printc(message, Colors.OKBLUE)
|
||||
|
||||
try:
|
||||
self.process = subprocess.Popen(self.command,
|
||||
stderr=self.reporter.out,
|
||||
|
@ -432,7 +433,7 @@ class TestsManager(Loggable):
|
|||
return False
|
||||
|
||||
def list_tests(self):
|
||||
pass
|
||||
return self.tests
|
||||
|
||||
def add_test(self, test):
|
||||
if self._is_test_wanted(test):
|
||||
|
@ -486,15 +487,17 @@ class TestsManager(Loggable):
|
|||
|
||||
return False
|
||||
|
||||
def run_tests(self):
|
||||
def run_tests(self, cur_test_num, total_num_tests):
|
||||
i = cur_test_num
|
||||
for test in self.tests:
|
||||
if self._is_test_wanted(test):
|
||||
self.reporter.before_test(test)
|
||||
res = test.run()
|
||||
self.reporter.after_test()
|
||||
if res != Result.PASSED and (self.options.forever or
|
||||
self.options.fatal_error):
|
||||
return test.result
|
||||
sys.stdout.write("[%d / %d] " % (i, total_num_tests))
|
||||
self.reporter.before_test(test)
|
||||
res = test.run()
|
||||
i += 1
|
||||
self.reporter.after_test()
|
||||
if res != Result.PASSED and (self.options.forever or
|
||||
self.options.fatal_error):
|
||||
return test.result
|
||||
|
||||
return Result.PASSED
|
||||
|
||||
|
@ -577,10 +580,18 @@ class _TestsLauncher(Loggable):
|
|||
for tester in self.testers:
|
||||
tester.list_tests()
|
||||
self.tests.extend(tester.tests)
|
||||
return self.tests
|
||||
|
||||
def _run_tests(self):
|
||||
cur_test_num = 0
|
||||
total_num_tests = 0
|
||||
for tester in self.testers:
|
||||
res = tester.run_tests()
|
||||
total_num_tests += len(tester.list_tests())
|
||||
print total_num_tests
|
||||
|
||||
for tester in self.testers:
|
||||
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
|
||||
self.options.fatal_error):
|
||||
return False
|
||||
|
|
Loading…
Reference in a new issue