diff options
author | Chris Liddell <chris.liddell@artifex.com> | 2017-12-01 15:16:19 +0000 |
---|---|---|
committer | Chris Liddell <chris.liddell@artifex.com> | 2017-12-01 15:16:19 +0000 |
commit | 69f4ea2d9d86b9eccf5e3477e4dc9d7d51e1d2d8 (patch) | |
tree | 6bbb5368036247285e49975367028083c5713fca | |
parent | efc24229b0ba4b2f6a39fe89a4c9c576dbe7e124 (diff) | |
download | ghostpdl-69f4ea2d9d86b9eccf5e3477e4dc9d7d51e1d2d8.tar.gz |
Remove obsolete check_source.py tool....
and its configuration file (testing.cfg.example).
Bug 698780 (related)
-rwxr-xr-x | toolbin/tests/check_source.py | 149 | ||||
-rw-r--r-- | toolbin/tests/testing.cfg.example | 62 |
2 files changed, 0 insertions, 211 deletions
diff --git a/toolbin/tests/check_source.py b/toolbin/tests/check_source.py deleted file mode 100755 index b97f2364e..000000000 --- a/toolbin/tests/check_source.py +++ /dev/null @@ -1,149 +0,0 @@ -#!/usr/bin/env python - -# Copyright (C) 2001-2012 Artifex Software, Inc. -# All Rights Reserved. -# -# This software is provided AS-IS with no warranty, either express or -# implied. -# -# This software is distributed under license and may not be copied, -# modified or distributed except as expressly authorized under the terms -# of the license contained in the file LICENSE in this distribution. -# -# Refer to licensing information at http://www.artifex.com or contact -# Artifex Software, Inc., 7 Mt. Lassen Drive - Suite A-134, San Rafael, -# CA 94903, U.S.A., +1(415)492-9861, for further information. -# - - -# Check basic hygiene of source code. - -import os -from gstestutils import GSTestCase, gsRunTestsMain - -################ Check that every file certain to be source has an -################ Id or RCSfile line. - -class GSCheckForIdLines(GSTestCase): - - def __init__(self, root, dirName, extensions = ['*'], skip = []): - self.root = root - self.dirName = dirName - self.extensions = extensions - self.skip = skip - GSTestCase.__init__(self) - - def shortDescription(self): - return "All relevant files must have correct Id or RCSfile lines. (checking %s/)" % self.dirName - - def runTest(self): - import re, glob - pattern = re.compile("[$][ ]*(Id|RCSfile):[ ]*([^, \t\$]+)") - d, extns, omit = self.root + self.dirName, self.extensions, self.skip - omit = map((lambda o,d=d: d+'/'+o), omit) - missing = [] - incorrect = [] - for e in extns: - for f in glob.glob(d + '/*.' + e): - if f in omit or f[-8:] == '.mak.tcl' or os.path.isdir(f): - continue - fp = open(f, 'r') - contents = fp.read(10000) - fp.close() - if len(contents) < 20: # skip very short files - continue - found = pattern.search(contents) - if found == None: - missing.append(f) - elif found.group(2) != os.path.basename(f): - incorrect.append(f + ' has ' + found.group(1) + ': '+ found.group(2)) - if missing: - missing = ['These %d files have no Id or RCSfile line:' % len(missing)] + missing - if incorrect: - incorrect = ['These %d files have an incorrect Id or RCSfile line:' % len(incorrect)] + incorrect - self.failIfMessages(missing + incorrect) - -################ Check that all .h files have Ghostscript standard -################ double-inclusion protection. - -class GSCheckDoubleInclusion(GSTestCase): - - def __init__(self, root, skip = []): - self.root = root - self.skip = map(lambda f,r=self.root: r+f, skip) - GSTestCase.__init__(self) - - def runTest(self): - """All .h files must have double-inclusion protection.""" - import re, glob - messages = [] - for fname in glob.glob(self.root + 'src/*.h'): - if fname in self.skip: - continue - # Double inclusion protection is required, but the name of the - # preprocessor symbol doesn't have to follow the Ghostscript - # convention. - fp = open(fname, 'r') - found = 0 - while 1: - line = fp.readline() - if not line: - break # EOF - line = line.strip() - if not line: - continue # skip blank lines - if line[:2] == '//': - continue # skip single-line comments - if re.match(r'\s*\/\*', line): # skip comments - while not re.search(r'\*\/', line): - line = fp.readline() - if not line: - break # EOF - if not line: - break # EOF - continue - m = re.match(r'#[ ]*if(ndef[ ]+([a-zA-Z0-9_]+)|[ ]+!defined\(([a-zA-Z0-9_]+)\))$', line) - if m: - # Check for #define in the next line. - sym = m.group(2) or m.group(3) - line = fp.readline().strip() - if re.match(r'#[ ]*define[ ]+' + sym + r'[\s]*$', line): - found = 1 - break - break # no protection - fp.close() - if not found: - messages.append(fname) - if messages: - messages = ['These %d files do not have double-inclusion protection:' % len(messages)] + messages - self.failIfMessages(messages) - -################ Main program - -gsSourceSets = [ - ('doc', ['*'], ['Changes.htm', 'gsdoc.el', 'FTL.txt']), - ('lib', ['eps', 'ps'], []), - ('man', ['*'], []), - ('src', ['c', 'cpp', 'h', 'mak'], []), - ('toolbin', ['*'], ['pre.chk']) - ] -gsDoubleInclusionOK = [ - 'src/gconf.h', - 'src/gxdtfill.h', - 'src/gxfillsl.h', - 'src/gxfilltr.h', - 'src/gxfillts.h', - 'src/gxsamplp.h', - 'src/gdevpdfb.h', - 'src/idicttpl.h' - ] - -# Add the tests defined in this file to a suite. - -def addTests(suite, gsroot, **args): - for dir, extns, skip in gsSourceSets: - suite.addTest(GSCheckForIdLines(gsroot, dir, extns, skip)) - suite.addTest(GSCheckDoubleInclusion(gsroot, gsDoubleInclusionOK)) - -if __name__ == "__main__": - gsRunTestsMain(addTests) diff --git a/toolbin/tests/testing.cfg.example b/toolbin/tests/testing.cfg.example deleted file mode 100644 index fe55ceb5f..000000000 --- a/toolbin/tests/testing.cfg.example +++ /dev/null @@ -1,62 +0,0 @@ -# paths - -root /home/regression/ - -# latest revision built in root -gsroot /home/regression/HEAD/ -# latest revision installed to gshead -installtree /home/regression/gshead/ -# latest revision path to executable -headinstallpath /home/regression/gshead/bin/gs - -comparefiledir /home/regression/comparefiles/ -comparefileall /home/regression/comparefiles/ - -crashfiledir /home/regression/crashfiles/ -codedir /home/regression/regression/ -datadir /home/regression/regression/ -logdir /home/regression/regression/logs/ -testdir /home/regression/regression/test/ - -dailydir /home/regression/regression/daily/ -rasterdbdir /home/regression/regression/raster/ -rasterdir /home/regression/regression/raster/ -fontdir /home/regression/fonts/ -workdir /home/regression/regression/work/ - -# programs -fuzzy /home/regression/regression/fuzzy - -# data filenames -baselinedb /home/regression/regression/baseline/baseline.db -baseline_log /home/regression/regression/baseline/baseline.log - -# nightly report options -mail_server localhost -report_to gs-regression@ghostscript.com -report_from gs-regression@ghostscript.com -mailkeyword xefitra - -# scripts -run_regression_script /home/regression/regression/run_regression.py -testdiff_script /home/regression/regression/testdiff.py -get_baseline_log_script /home/regression/regression/get_baseline_log.py - -# put into logdir defined above -update_stdout update-stdout -update_stderr update-stderr -config_stdout config-stdout -config_stderr config-stderr -make_stdout make-stdout -make_stderr make-stderr -install_stdout install-stdout -install_stderr install-stderr -gs_stdout gs-stdout -gs_stderr gs-stderr -differences differences -baselines baseline_changes -regression regression -cumulative cumulative -email email -history history - |