tests/check-perf-code.py
changeset 29570 cbd240188e4e
child 29571 d1a7d9c279bb
equal deleted inserted replaced
29569:3d52e7c78a6b 29570:cbd240188e4e
       
     1 #!/usr/bin/env python
       
     2 #
       
     3 # check-perf-code - (historical) portability checker for contrib/perf.py
       
     4 
       
     5 from __future__ import absolute_import
       
     6 
       
     7 import os
       
     8 import sys
       
     9 
       
    10 # write static check patterns here
       
    11 perfpypats = [
       
    12   [
       
    13   ],
       
    14   # warnings
       
    15   [
       
    16   ]
       
    17 ]
       
    18 
       
    19 if __name__ == "__main__":
       
    20     # import contrib/check-code.py as checkcode
       
    21     assert 'RUNTESTDIR' in os.environ, "use check-perf-code.py in *.t script"
       
    22     contribpath = os.path.join(os.environ['RUNTESTDIR'], '..', 'contrib')
       
    23     sys.path.insert(0, contribpath)
       
    24     checkcode = __import__('check-code')
       
    25 
       
    26     # register perf.py specific entry with "checks" in check-code.py
       
    27     checkcode.checks.append(('perf.py', r'contrib/perf.py$', '',
       
    28                              checkcode.pyfilters, perfpypats))
       
    29 
       
    30     sys.exit(checkcode.main())