Browse Source

[trac904] some pre-work refactoring: replaced - with _ so that we can
import the script from python (just for development convenience).
also define the gen script as noinst_SCRIPTS (agian, just for development
convenience). but this will cause a regression in the process_rename_test,
which was fixed, too.

JINMEI Tatuya 13 years ago
parent
commit
c42eef08cd

+ 1 - 1
configure.ac

@@ -931,7 +931,7 @@ AC_OUTPUT([doc/version.ent
            src/lib/python/isc/log/tests/log_console.py
            src/lib/dns/gen-rdatacode.py
            src/lib/python/bind10_config.py
-           src/lib/dns/tests/testdata/gen-wiredata.py
+           src/lib/dns/tests/testdata/gen_wiredata.py
            src/lib/cc/session_config.h.pre
            src/lib/cc/tests/session_unittests_config.h
            src/lib/log/tests/console_test.sh

+ 1 - 1
src/bin/auth/tests/testdata/Makefile.am

@@ -23,4 +23,4 @@ EXTRA_DIST += example.com
 EXTRA_DIST += example.sqlite3
 
 .spec.wire:
-	$(abs_top_builddir)/src/lib/dns/tests/testdata/gen-wiredata.py -o $@ $<
+	$(PYTHON) $(abs_top_builddir)/src/lib/dns/tests/testdata/gen_wiredata.py -o $@ $<

+ 1 - 0
src/bin/tests/Makefile.am

@@ -1,5 +1,6 @@
 PYCOVERAGE_RUN = @PYCOVERAGE_RUN@
 PYTESTS = process_rename_test.py
+noinst_SCRIPTS = $(PYTESTS)
 # .py will be generated by configure, so we don't have to include it
 # in EXTRA_DIST.
 

+ 6 - 3
src/bin/tests/process_rename_test.py.in

@@ -38,8 +38,10 @@ class TestRename(unittest.TestCase):
         Then scan them by looking at the source text
         (without actually running them)
         """
-        # Regexp to find all the *_SCRIPTS = something lines,
-        # including line continuations (backslash and newline)
+        # Regexp to find all the *_SCRIPTS = something lines (except for
+        # noinst_SCRIPTS, which are scripts for tests), including line
+        # continuations (backslash and newline)
+        excluded_lines = re.compile(r'^(noinst_SCRIPTS.*$)', re.MULTILINE)
         lines = re.compile(r'^\w+_SCRIPTS\s*=\s*((.|\\\n)*)$',
             re.MULTILINE)
         # Script name regular expression
@@ -53,7 +55,8 @@ class TestRename(unittest.TestCase):
             if 'Makefile' in fs:
                 makefile = ''.join(open(os.path.join(d,
                     "Makefile")).readlines())
-                for (var, _) in lines.findall(makefile):
+                for (var, _) in lines.findall(re.sub(excluded_lines, '',
+                                                     makefile)):
                     for (script, _) in scripts.findall(var):
                         self.__scan(d, script, fun)
 

+ 4 - 3
src/lib/dns/tests/testdata/Makefile.am

@@ -47,10 +47,11 @@ BUILT_SOURCES += tsig_verify4.wire tsig_verify5.wire tsig_verify6.wire
 BUILT_SOURCES += tsig_verify7.wire tsig_verify8.wire tsig_verify9.wire
 BUILT_SOURCES += tsig_verify10.wire
 
+noinst_SCRIPTS = gen_wiredata.py
+
 # NOTE: keep this in sync with real file listing
 # so is included in tarball
-EXTRA_DIST = gen-wiredata.py.in
-EXTRA_DIST += edns_toWire1.spec edns_toWire2.spec
+EXTRA_DIST = edns_toWire1.spec edns_toWire2.spec
 EXTRA_DIST += edns_toWire3.spec edns_toWire4.spec
 EXTRA_DIST += masterload.txt
 EXTRA_DIST += message_fromWire1 message_fromWire2
@@ -123,4 +124,4 @@ EXTRA_DIST += tsig_verify7.spec tsig_verify8.spec tsig_verify9.spec
 EXTRA_DIST += tsig_verify10.spec
 
 .spec.wire:
-	./gen-wiredata.py -o $@ $<
+	$(PYTHON) ./gen_wiredata.py -o $@ $<

src/lib/dns/tests/testdata/gen-wiredata.py.in → src/lib/dns/tests/testdata/gen_wiredata.in


+ 1 - 1
src/lib/testutils/testdata/Makefile.am

@@ -32,4 +32,4 @@ EXTRA_DIST += test2.zone.in
 EXTRA_DIST += test2-new.zone.in
 
 .spec.wire:
-	$(abs_top_builddir)/src/lib/dns/tests/testdata/gen-wiredata.py -o $@ $<
+	$(PYTHON) $(abs_top_builddir)/src/lib/dns/tests/testdata/gen_wiredata.py -o $@ $<