shithub: aubio

ref: 779966bd7d91e0ff09e26d8d2f8524791e72e5b4
dir: /tests/python/run_all_tests/

View raw version
#! /usr/bin/python

import unittest

from glob import glob
def list_of_test_files(path):
  matches = glob(path)
  if not matches: print "WARNING: no matches for %s" % path
  return [i.split('.')[0].replace('/','.') for i in matches]

modules_to_test  = []
modules_to_test += ['localaubio']
modules_to_test += list_of_test_files('src/*.py')
modules_to_test += list_of_test_files('src/*/*.py')
modules_to_test += list_of_test_files('examples/aubio*.py')
modules_to_test += list_of_test_files('*.py')

if __name__ == '__main__':
  for module in modules_to_test: 
    if module != 'run_all_tests': # (not actually needed)
      exec('from %s import *' % module)
  unittest.main()