Loosen check for build directory.
authorDiego Novillo <dnovillo@google.com>
Thu, 18 Apr 2013 18:11:05 +0000 (14:11 -0400)
committerDiego Novillo <dnovillo@gcc.gnu.org>
Thu, 18 Apr 2013 18:11:05 +0000 (14:11 -0400)
* validate_failures.py: Loosen check for build directory.
State what failed if we couldn't find the source tree or
the target triplet.

From-SVN: r198064

contrib/ChangeLog
contrib/testsuite-management/validate_failures.py

index c97ae95c3a85da8db92caabebec1c4b04cc53463..3dd147be9e80d23317cc31bcd08c717aab97eb9c 100644 (file)
@@ -1,3 +1,9 @@
+2013-04-18  Diego Novillo  <dnovillo@google.com>
+
+       * validate_failures.py: Loosen check for build directory.
+       State what failed if we couldn't find the source tree or
+       the target triplet.
+
 2013-03-22  Jakub Jelinek  <jakub@redhat.com>
 
        * gennews (files): Add files for GCC 4.8.
index 74dbcfb035ce68829cc9130fc59e02415ed6e06a..aa71c940df9c9fffe00cb4c5f1bc48f0c4e0d23e 100755 (executable)
@@ -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