Upstream version 5.34.92.0
[platform/framework/web/crosswalk.git] / src / third_party / trace-viewer / run_tests
1 #!/usr/bin/env python
2 import unittest
3 import sys
4 import os
5
6 import build # Brings in tvcm bindings.
7 import tvcm
8
9 __all__ = []
10
11 def Main():
12   class AllTestLoader(unittest.TestLoader):
13     def addTestsInDirToSuite(self, suite, start_dir, top_dir):
14       subsuite = self.discover(start_dir,
15                             "*unittest.py",
16                             top_dir)
17       suite.addTest(subsuite)
18
19     def loadTestsFromModule(self, module, use_load_tests=True):
20       if module.__file__ == __file__:
21         suite = unittest.TestSuite()
22         self.addTestsInDirToSuite(suite,
23                                   os.path.join(os.path.dirname(__file__), "build"),
24                                   os.path.dirname(__file__))
25         tvcm_top_dir = os.path.join(os.path.dirname(__file__), "third_party", "tvcm")
26         self.addTestsInDirToSuite(suite,
27                                   os.path.join(tvcm_top_dir, "tvcm"),
28                                   tvcm_top_dir)
29         return suite
30       return super(AllTestLoader, self).loadTestsFromModule(module, use_load_tests)
31   return unittest.main(testLoader=AllTestLoader())
32
33 if __name__ == '__main__':
34   sys.exit(Main())