[svn] commit: r2878 - /branches/trac322/src/lib/python/isc/bind10/tests/rename.py

BIND 10 source code commits bind10-changes at lists.isc.org
Wed Sep 8 22:16:30 UTC 2010


Author: vorner
Date: Wed Sep  8 22:16:27 2010
New Revision: 2878

Log:
Guess the scripts to check for renaming

It looks into Makefile.am, hopefully the scripts will be only python.
When there start to be more languages, there'll be need to guess that
somehow too.

Modified:
    branches/trac322/src/lib/python/isc/bind10/tests/rename.py

Modified: branches/trac322/src/lib/python/isc/bind10/tests/rename.py
==============================================================================
--- branches/trac322/src/lib/python/isc/bind10/tests/rename.py (original)
+++ branches/trac322/src/lib/python/isc/bind10/tests/rename.py Wed Sep  8 22:16:27 2010
@@ -5,6 +5,7 @@
 import signal
 import subprocess
 import isc.bind10.rename
+import re
 
 class TestRename(unittest.TestCase):
     def get_self_name(self):
@@ -17,5 +18,18 @@
         isc.bind10.rename.rename()
         self.assertEqual("rename.py", self.get_self_name())
 
+    # This finds all python scripts and tries to find if they call the function
+    def test_calls(self):
+        scripts = re.compile('^\\w+_SCRIPTS\\s*=\\s*((.|\\\\\\n)*)$',
+            re.MULTILINE)
+        for (d, _, fs) in os.walk('../../../../../', followlinks = True):
+            if 'Makefile.am' in fs:
+                print("Found Makefile.am in " + d)
+                makefile = ''.join(open(os.path.join(d,
+                    "Makefile.am")).readlines())
+                # XXX Continue here, parse out the file names and check them
+                print(str(scripts.findall(makefile)))
+        self.assert_(False)
+
 if __name__ == "__main__":
     unittest.main()




More information about the bind10-changes mailing list