aboutsummaryrefslogtreecommitdiff
path: root/contrib
diff options
context:
space:
mode:
authorDiego Novillo <dnovillo@google.com>2013-02-06 15:22:56 -0500
committerDiego Novillo <dnovillo@gcc.gnu.org>2013-02-06 15:22:56 -0500
commit828e50c53cc7d1d4e30ba32e2a7c7343d7f5fe46 (patch)
treebc7faa6754990b2b335ea01836a03900191f9880 /contrib
parentd0c4e31020ff1f11fe4db2dd1f66f111d2078217 (diff)
downloadgcc-828e50c53cc7d1d4e30ba32e2a7c7343d7f5fe46.zip
gcc-828e50c53cc7d1d4e30ba32e2a7c7343d7f5fe46.tar.gz
gcc-828e50c53cc7d1d4e30ba32e2a7c7343d7f5fe46.tar.bz2
Fix validate_failures.py in standalone testing.
When using validate_failures.py with --manifest and --results, we don't need a GCC build directory. This is useful when using the validator outside of the build tree. We were insisting on finding a valid build tree regardless of those options. Tested on x86_64. Committed to trunk. * testsuite-management/validate_failures.py: Update Copyright years. Request contributions not to use Python features newer than 2.4. (GetBuildData): If this is not a build directory, emit an error only if --results or --manifest are missing. From-SVN: r195817
Diffstat (limited to 'contrib')
-rw-r--r--contrib/ChangeLog9
-rwxr-xr-xcontrib/testsuite-management/validate_failures.py28
2 files changed, 30 insertions, 7 deletions
diff --git a/contrib/ChangeLog b/contrib/ChangeLog
index 0ace63e..2e4db76 100644
--- a/contrib/ChangeLog
+++ b/contrib/ChangeLog
@@ -1,3 +1,12 @@
+2013-02-06 Diego Novillo <dnovillo@google.com>
+
+ * testsuite-management/validate_failures.py: Update
+ Copyright years.
+ Request contributions not to use Python features newer
+ than 2.4.
+ (GetBuildData): If this is not a build directory,
+ emit an error only if --results or --manifest are missing.
+
2013-02-06 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
* testsuite-management/validate_failures.py
diff --git a/contrib/testsuite-management/validate_failures.py b/contrib/testsuite-management/validate_failures.py
index 5c80ca3..76f9aab 100755
--- a/contrib/testsuite-management/validate_failures.py
+++ b/contrib/testsuite-management/validate_failures.py
@@ -2,10 +2,14 @@
# Script to compare testsuite failures against a list of known-to-fail
# tests.
+#
+# NOTE: This script is used in installations that are running Python 2.4.
+# Please stick to syntax features available in 2.4 and earlier
+# versions.
# Contributed by Diego Novillo <dnovillo@google.com>
#
-# Copyright (C) 2011, 2012 Free Software Foundation, Inc.
+# Copyright (C) 2011-2013 Free Software Foundation, Inc.
#
# This file is part of GCC.
#
@@ -78,7 +82,7 @@ _MANIFEST_PATH_PATTERN = '%s/%s/%s.xfail'
_OPTIONS = None
def Error(msg):
- print >>sys.stderr, '\nerror: %s' % msg
+ print >>sys.stderr, 'error: %s' % msg
sys.exit(1)
@@ -358,15 +362,24 @@ def GetManifestPath(srcdir, target, user_provided_must_exist):
Error('Manifest does not exist: %s' % manifest_path)
return manifest_path
else:
+ assert srdir and target
return _MANIFEST_PATH_PATTERN % (srcdir, _MANIFEST_SUBDIR, target)
def GetBuildData():
- target = GetMakefileValue('%s/Makefile' % _OPTIONS.build_dir, 'target_alias=')
srcdir = GetMakefileValue('%s/Makefile' % _OPTIONS.build_dir, 'srcdir =')
+ target = GetMakefileValue('%s/Makefile' % _OPTIONS.build_dir, 'target_alias=')
if not ValidBuildDirectory(_OPTIONS.build_dir, target):
- Error('%s is not a valid GCC top level build directory.' %
- _OPTIONS.build_dir)
+ # If we have been given a set of results to use, we may
+ # not be inside a valid GCC build directory. In that case,
+ # the user must provide both a manifest file and a set
+ # of results to check against it.
+ if not _OPTIONS.results or not _OPTIONS.manifest:
+ Error('%s is not a valid GCC top level build directory. '
+ 'You must use --manifest and --results to do the validation.' %
+ _OPTIONS.build_dir)
+ else:
+ return None, None
print 'Source directory: %s' % srcdir
print 'Build target: %s' % target
return srcdir, target
@@ -410,7 +423,7 @@ def PerformComparison(expected, actual, ignore_missing_failures):
def CheckExpectedResults():
- (srcdir, target) = GetBuildData()
+ srcdir, target = GetBuildData()
manifest_path = GetManifestPath(srcdir, target, True)
print 'Manifest: %s' % manifest_path
manifest = GetManifest(manifest_path)
@@ -485,7 +498,8 @@ def Main(argv):
parser.add_option('--manifest', action='store', type='string',
dest='manifest', default=None,
help='Name of the manifest file to use (default = '
- 'taken from contrib/testsuite-managment/<target_alias>.xfail)')
+ 'taken from '
+ 'contrib/testsuite-managment/<target_alias>.xfail)')
parser.add_option('--produce_manifest', action='store_true',
dest='produce_manifest', default=False,
help='Produce the manifest for the current '