This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[contrib]: Loosen check of build directory in validate_failures.py


Some cross targets have different build directory names that those expected by the script. I loosened the check by simply making it check for the actual values we care to get out of the Makefile. This should remove some false positives we've been getting.

Committed to trunk.  Will backport to google/gcc-4_8 shortly.


Diego.

commit 6f25227972527ea90b61de84b283d840dcc49004
Author: dnovillo <dnovillo@138bc75d-0d04-0410-961f-82ee72b054a4>
Date:   Thu Apr 18 18:11:05 2013 +0000

    Loosen check for build directory.

        * validate_failures.py: Loosen check for build directory.
        State what failed if we couldn't find the source tree or
        the target triplet.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@198064 138bc75d-0d04-0410-96
1f-82ee72b054a4

diff --git a/contrib/testsuite-management/validate_failures.py b/contrib/testsuite-management/validate_failures.py
index 74dbcfb..aa71c94 100755
--- a/contrib/testsuite-management/validate_failures.py
+++ b/contrib/testsuite-management/validate_failures.py
@@ -196,11 +196,9 @@ def GetMakefileValue(makefile_name, value_name):
   return None


-def ValidBuildDirectory(builddir, target):
+def ValidBuildDirectory(builddir):
   if (not os.path.exists(builddir) or
-      not os.path.exists('%s/Makefile' % builddir) or
-      (not os.path.exists('%s/build-%s' % (builddir, target)) and
-       not os.path.exists('%s/%s' % (builddir, target)))):
+      not os.path.exists('%s/Makefile' % builddir)):
     return False
   return True

@@ -362,14 +360,17 @@ def GetManifestPath(srcdir, target, user_provided_must_exist):
       Error('Manifest does not exist: %s' % manifest_path)
     return manifest_path
   else:
-    assert srcdir and target
+    if not srcdir:
+ Error('Could not determine where the location of GCC\'s source tree. '
+            'The Makefile does not contain a definition for "srcdir".')
+    if not target:
+      Error('Could not determine the target triplet for this build. '
+ 'The Makefile does not contain a definition for "target_alias".')
     return _MANIFEST_PATH_PATTERN % (srcdir, _MANIFEST_SUBDIR, target)


 def GetBuildData():
-  srcdir = GetMakefileValue('%s/Makefile' % _OPTIONS.build_dir, 'srcdir =')
- target = GetMakefileValue('%s/Makefile' % _OPTIONS.build_dir, 'target_alias=')
-  if not ValidBuildDirectory(_OPTIONS.build_dir, target):
+  if not ValidBuildDirectory(_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
@@ -380,6 +381,8 @@ def GetBuildData():
             _OPTIONS.build_dir)
     else:
       return None, None
+  srcdir = GetMakefileValue('%s/Makefile' % _OPTIONS.build_dir, 'srcdir =')
+ target = GetMakefileValue('%s/Makefile' % _OPTIONS.build_dir, 'target_alias=')
   print 'Source directory: %s' % srcdir
   print 'Build target:     %s' % target
   return srcdir, target


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]