Rizin
unix-like reverse engineering framework and cli tools
regress.py
Go to the documentation of this file.
1 #!/usr/bin/python
2 
3 import unittest
4 
5 from os.path import dirname, basename, isfile
6 import glob
7 
8 # Find all unittest type in this directory and run it.
9 
10 class RegressTest(unittest.TestCase):
11  pass
12 
13 def main():
14  unittest.main()
15 
16 if __name__ == '__main__':
17  directory = dirname(__file__)
18  if directory == '':
19  directory = '.'
20  modules = glob.glob(directory+"/*.py")
21  __all__ = [ basename(f)[:-3] for f in modules if isfile(f)]
22  suite = unittest.TestSuite()
23 
24  for module in __all__:
25  m = __import__(module)
26  for cl in dir(m):
27  try:
28  realcl = getattr(m,cl)
29  if issubclass(realcl, unittest.TestCase):
30  suite.addTest(realcl())
31  except Exception as e:
32  pass
33 
34  unittest.TextTestRunner().run(suite)
#define basename
Definition: libiberty.h:109
def main()
Definition: regress.py:13
realcl
Definition: regress.py:28
static int run(int i, const char *arg)
Definition: rz-bb.c:19