source: orange/testing/unittests/test-examples.py @ 7903:f4d128b9588a

Revision 7903:f4d128b9588a, 894 bytes checked in by ales_erjavec <ales.erjavec@…>, 3 years ago (diff)
Line 
1import unittest
2import os, sys
3from optparse import OptionParser
4
5import orange
6
7option = OptionParser()
8option.add_option("-m", "--module", type=str, dest="module", default="orange", help="List the modules to test (Possible values: orange, obi, text)")
9option.add_option("-o", "--output", type=str, dest="output", default=None, help="Output file (default is standard output)")
10
11options, args = option.parse_args()
12
13module = options.module
14output = options.output
15
16dirs = {"orange": "doc/modules",
17        "obi": "add-ons/Bioinformatics/doc/modules",
18        "text": "add-ons/Text/doc/modules"
19        }
20
21if module not in dirs:
22    print "Unknown module name!"
23    sys.exit(1)
24   
25orangedir = os.path.dirname(orange.__file__)
26   
27from Orange.testing import test_suite_scripts
28
29suite = test_suite_scripts(os.path.join(orangedir, dirs[module]))
30unittest.TextTestRunner(verbosity=2).run(suite)
31
Note: See TracBrowser for help on using the repository browser.