source: python/run_all_tests @ f360ad8

feature/autosinkfeature/constantqfeature/pitchshiftfeature/pydocstringsfeature/timestretchpitchshiftsamplertimestretchyinfft+
Last change on this file since f360ad8 was f360ad8, checked in by Paul Brossier <piem@piem.org>, 7 years ago

build_linux: update path

  • Property mode set to 100755
File size: 769 bytes
Line 
1#! /usr/bin/env python
2
3if __name__ == '__main__':
4  import os, sys, unittest
5  def load_test():
6    # get relevant files
7    curdir = os.path.dirname(sys.argv[0])
8    if curdir == '': curdir = '.'
9    files = os.listdir(os.path.join(curdir, 'tests'))
10    modfiles = filter (lambda y: y.endswith('.py'), files) 
11    modfiles = filter (lambda f: f.startswith('test_'), modfiles)
12    # get module names
13    modnames = map (lambda x: os.path.splitext(x)[0], modfiles)
14    # import them
15    modules = map (__import__, modnames)
16    # create a test suites from the imported module
17    load_from_module = unittest.defaultTestLoader.loadTestsFromModule
18    tests = map(load_from_module, modules)
19    return unittest.TestSuite(tests)
20  unittest.main(defaultTest = 'load_test')
Note: See TracBrowser for help on using the repository browser.