tests/python/run_all_tests: add a warning if list_of_test_files returns no matches...
[aubio.git] / tests / python / run_all_tests
1 #! /usr/bin/python
2
3 import unittest
4
5 from glob import glob
6 def list_of_test_files(path):
7   matches = glob(path)
8   if not matches: print "WARNING: no matches for %s" % path
9   return [i.split('.')[0].replace('/','.') for i in matches]
10
11 modules_to_test  = []
12 modules_to_test += ['localaubio']
13 modules_to_test += list_of_test_files('src/*.py')
14 modules_to_test += list_of_test_files('src/*/*.py')
15 modules_to_test += list_of_test_files('examples/aubio*.py')
16 modules_to_test += list_of_test_files('*.py')
17
18 if __name__ == '__main__':
19   for module in modules_to_test: 
20     if module != 'run_all_tests': # (not actually needed)
21       exec('from %s import *' % module)
22   unittest.main()