tests/src/io/test-source.c: default to source samplerate, add hop_size option, print...
[aubio.git] / tests / python / run_all_tests
index f09eaec3bc8baa9732fa70731cded2be59e2ca41..68caefb2ff6f45cd9cda3dfc49fdde9fe853f0bb 100755 (executable)
@@ -1,17 +1,22 @@
 #! /usr/bin/python
 
-# add ${src}/python and ${src}/python/aubio/.libs to python path
-# so the script is runnable from a compiled source tree.
-import sys, os
-
-cur_dir = os.path.dirname(sys.argv[0])
-sys.path.append(os.path.join(cur_dir,'..','..','python'))
-sys.path.append(os.path.join(cur_dir,'..','..','python','aubio','.libs'))
-
 import unittest
 
-modules_to_test = ['aubiomodule', 'fvec', 'cvec']
+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: exec('from %s import *' % module)
+  for module in modules_to_test: 
+    if module != 'run_all_tests': # (not actually needed)
+      exec('from %s import *' % module)
   unittest.main()