PageRenderTime 153ms CodeModel.GetById 15ms RepoModel.GetById 0ms app.codeStats 0ms

/tools/grit/grit/test_suite_all.py

https://github.com/akesling/chromium
Python | 85 lines | 63 code | 12 blank | 10 comment | 3 complexity | 457c0a338a1858b76bb5144d760a96df MD5 | raw file
  1. #!/usr/bin/python2.4
  2. # Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
  3. # Use of this source code is governed by a BSD-style license that can be
  4. # found in the LICENSE file.
  5. '''Unit test suite that collects all test cases for GRIT.'''
  6. import os
  7. import sys
  8. if __name__ == '__main__':
  9. sys.path.append(os.path.join(os.path.dirname(sys.argv[0]), '..'))
  10. import unittest
  11. # TODO(joi) Use unittest.defaultTestLoader to automatically load tests
  12. # from modules. Iterating over the directory and importing could then
  13. # automate this all the way, if desired.
  14. class TestSuiteAll(unittest.TestSuite):
  15. def __init__(self):
  16. super(type(self), self).__init__()
  17. # Imports placed here to prevent circular imports.
  18. from grit import grd_reader_unittest
  19. from grit import grit_runner_unittest
  20. from grit.node import base_unittest
  21. from grit.node import io_unittest
  22. from grit import clique_unittest
  23. from grit.node import misc_unittest
  24. from grit.gather import rc_unittest
  25. from grit.gather import tr_html_unittest
  26. from grit.node import message_unittest
  27. from grit import tclib_unittest
  28. import grit.format.rc_unittest
  29. import grit.format.data_pack_unittest
  30. from grit.tool import rc2grd_unittest
  31. from grit.tool import transl2tc_unittest
  32. from grit.gather import txt_unittest
  33. from grit.gather import admin_template_unittest
  34. from grit import xtb_reader_unittest
  35. from grit import util_unittest
  36. from grit.tool import preprocess_unittest
  37. from grit.tool import postprocess_unittest
  38. from grit import shortcuts_unittests
  39. from grit.gather import muppet_strings_unittest
  40. from grit.node.custom import filename_unittest
  41. test_classes = [
  42. base_unittest.NodeUnittest,
  43. io_unittest.FileNodeUnittest,
  44. grit_runner_unittest.OptionArgsUnittest,
  45. grd_reader_unittest.GrdReaderUnittest,
  46. clique_unittest.MessageCliqueUnittest,
  47. misc_unittest.GritNodeUnittest,
  48. rc_unittest.RcUnittest,
  49. tr_html_unittest.ParserUnittest,
  50. tr_html_unittest.TrHtmlUnittest,
  51. message_unittest.MessageUnittest,
  52. tclib_unittest.TclibUnittest,
  53. grit.format.rc_unittest.FormatRcUnittest,
  54. grit.format.data_pack_unittest.FormatDataPackUnittest,
  55. rc2grd_unittest.Rc2GrdUnittest,
  56. transl2tc_unittest.TranslationToTcUnittest,
  57. txt_unittest.TxtUnittest,
  58. admin_template_unittest.AdmGathererUnittest,
  59. xtb_reader_unittest.XtbReaderUnittest,
  60. misc_unittest.IfNodeUnittest,
  61. util_unittest.UtilUnittest,
  62. preprocess_unittest.PreProcessingUnittest,
  63. postprocess_unittest.PostProcessingUnittest,
  64. misc_unittest.ReleaseNodeUnittest,
  65. shortcuts_unittests.ShortcutsUnittest,
  66. muppet_strings_unittest.MuppetStringsUnittest,
  67. filename_unittest.WindowsFilenameUnittest,
  68. # add test classes here...
  69. ]
  70. for test_class in test_classes:
  71. self.addTest(unittest.makeSuite(test_class))
  72. if __name__ == '__main__':
  73. unittest.TextTestRunner(verbosity=2).run(TestSuiteAll())