blob: 8495f71123fd4a2e732c17bc9e3a7e18ee58c75f [file] [log] [blame]
#!/usr/bin/python2
"""Target for running all performance test cases."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import importlib
import os
import sys
import unittest
# The parent directory is a module
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.realpath(__file__))))
# pylint: disable=C6204,C6203
import tv_testcase
def _add_test(test_suite, dir_path, test_name):
if os.path.isfile(os.path.join(dir_path, test_name + ".py")):
print("Adding test: {}".format(test_name))
test_suite.addTest(unittest.TestLoader().loadTestsFromModule(
importlib.import_module("tests." + test_name)))
# pylint: disable=unused-argument
def load_tests(loader, tests, pattern):
"""This is a Python unittest "load_tests protocol method."""
test_suite = unittest.TestSuite()
dir_path = os.path.dirname(__file__)
_add_test(test_suite, dir_path, "performance_non_video")
_add_test(test_suite, dir_path, "performance_video")
return test_suite
if __name__ == "__main__":
tv_testcase.main()