source: tests/list_missing_tests @ 79287252

feature/autosinkfeature/cnnfeature/cnn_orgfeature/constantqfeature/crepefeature/crepe_orgfeature/pitchshiftfeature/pydocstringsfeature/timestretchfix/ffmpeg5pitchshiftsamplertimestretchyinfft+
Last change on this file since 79287252 was 79287252, checked in by Paul Brossier <piem@piem.org>, 17 years ago

list_missing_tests: update to check all existing test

  • Property mode set to 100755
File size: 1.9 KB
RevLine 
[79287252]1#! /usr/bin/python
2
3from glob import glob
4from os.path import splitext, exists, join, dirname, basename
5import sys
6
7def check_tst_against_src(src_dir, src_ext, ext_dir, verbose = False, tst_prefix = ''):
8  src_files = [ basename(file) for file in glob( join(src_dir, '*'+src_ext) ) ]
9  src_files.sort()
10  status = 0
11  for src_file in src_files:
12    tst_file = (splitext(src_file)[0] + tst_ext).replace(tst_prefix,"")
13    if not exists(join(tst_dir,tst_prefix+tst_file)):
14      print "%20s [X]" % src_file, "[ ] %s" % tst_file
15      status = 1
16    elif verbose:
17      print "%20s [X]" % src_file, "[X] %s" % tst_file
18  return status
19
20def check_src_against_tst(tst_dir, tst_ext, src_dir, verbose = False, tst_prefix = 'test-'):
21  tst_files = [ basename(file) for file in glob( join(tst_dir, '*'+tst_ext) ) ]
22  tst_files.sort()
23  status = 0
24  for tst_file in tst_files:
25    src_file = (splitext(tst_file)[0] + src_ext).replace(tst_prefix,"")
26    if not exists(join(src_dir,src_file)):
27      print "%20s [ ]" % src_file, "[X] %s" % tst_file
28      status = 2
29    elif verbose:
30      print "%20s [X]" % src_file, "[X] %s" % tst_file
31  return status
32
33if __name__ == '__main__':
34
35  if len(sys.argv) > 1: verbose = True
36  else: verbose = False
37
38  src_dir = join(dirname(sys.argv[0]),'..','src')
39  src_ext = '.c'
40
41  tst_dir = join(dirname(sys.argv[0]),'python')
42  tst_ext = '.py'
43  print "%20s    " % (" FILES IN " + src_dir) + "|" + "    FILES IN " + tst_dir
44  status  = check_tst_against_src(src_dir, src_ext, tst_dir, verbose=verbose)
45  status += check_src_against_tst(tst_dir, tst_ext, src_dir, verbose=verbose)
46
47  tst_dir = join(dirname(sys.argv[0]),'src')
48  tst_ext = '.c'
49  print "%20s    " % (" FILES IN " + src_dir) + "|" + "    FILES IN " + tst_dir
50  status += check_tst_against_src(src_dir, src_ext, tst_dir, verbose=verbose, tst_prefix = 'test-')
51  status += check_src_against_tst(tst_dir, tst_ext, src_dir, verbose=verbose, tst_prefix = 'test-')
52
53  sys.exit(status)
Note: See TracBrowser for help on using the repository browser.