list_missing_tests: add script to get the list of missing test files
authorPaul Brossier <piem@piem.org>
Wed, 17 Oct 2007 16:17:59 +0000 (18:17 +0200)
committerPaul Brossier <piem@piem.org>
Wed, 17 Oct 2007 16:17:59 +0000 (18:17 +0200)
python/test/list_missing_tests [new file with mode: 0755]

diff --git a/python/test/list_missing_tests b/python/test/list_missing_tests
new file mode 100755 (executable)
index 0000000..3d5e574
--- /dev/null
@@ -0,0 +1,30 @@
+#! /usr/bin/python
+
+from glob import glob
+from os.path import splitext, exists
+import sys
+
+if len(sys.argv) > 1: verbose = True
+else: verbose = False
+
+cfiles = [ file.split('/')[-1] for file in glob('../../src/*.c') ]
+cfiles.sort()
+
+for cfile in cfiles: 
+  pythonfile=splitext(cfile)[0]+'.py'
+  if not exists(pythonfile):
+    print "[X] %30s" % cfile, "[ ] %30s" % pythonfile
+    #print cfile, "has NO test", pythonfile
+  elif verbose:
+    print "[X] %30s" % cfile, "[X] %30s" % pythonfile
+
+pythonfiles = [ file.split('/')[-1] for file in glob('*.py') ]
+pythonfiles.sort()
+
+for pythonfile in pythonfiles: 
+  cfile=splitext(pythonfile)[0]+'.c'
+  if not exists('../../'+cfile):
+    print "[ ] %30s" % cfile, "[X] %30s" % pythonfile
+    #print pythonfile, "has NO source", cfile
+  elif verbose:
+    print "[X] %30s" % cfile, "[X] %30s" % pythonfile