forked from glennhickey/teHmm
-
Notifications
You must be signed in to change notification settings - Fork 0
/
allTests.py
executable file
·47 lines (39 loc) · 1.6 KB
/
allTests.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#!/usr/bin/env python
#Copyright (C) 2012 by Glenn Hickey ([email protected])
#
#Released under the MIT license, see LICENSE.txtimport unittest
import unittest
import sys
import os
import argparse
from teHmm.tests.bedTrackTest import TestCase as bedTrackTest
from teHmm.tests.emissionTest import TestCase as emissionTest
from teHmm.tests.hmmTest import TestCase as hmmTest
from teHmm.tests.compareTest import TestCase as compareTest
from teHmm.tests.cfgTest import TestCase as cfgTest
from teHmm.tests.kmerTest import TestCase as kmerTest
from teHmm.common import addLoggingOptions, setLoggingFromOptions, logger
def allSuites():
allTests = unittest.TestSuite((unittest.makeSuite(bedTrackTest, 'test'),
unittest.makeSuite(emissionTest, 'test'),
unittest.makeSuite(hmmTest, 'test'),
unittest.makeSuite(compareTest, 'test'),
unittest.makeSuite(cfgTest, 'test'),
unittest.makeSuite(kmerTest, 'test')))
return allTests
def main(argv=None):
if argv is None:
argv = sys.argv
parser = argparse.ArgumentParser(
formatter_class=argparse.ArgumentDefaultsHelpFormatter,
description="Run unit tests")
addLoggingOptions(parser)
args = parser.parse_args()
setLoggingFromOptions(args)
suite = allSuites()
runner = unittest.TextTestRunner()
i = runner.run(suite)
return len(i.failures) + len(i.errors)
if __name__ == '__main__':
import sys
sys.exit(main())