Commits

Anonymous committed 135e250

Check for the existence of lex and yacc in those tests and bail with NO RESULT if they're not present..

Comments (0)

Files changed (6)

 os.chdir(scons_dir)
 
 fail = []
+no_result = []
 
 for path in tests:
     if os.path.isabs(path):
     cmd = string.join(["python", debug, abs], " ")
     if printcmd:
 	print cmd
-    if os.system(cmd):
-	fail.append(path)
+    s = os.system(cmd)
+    if s == 1:
+        fail.append(path)
+    elif s == 2:
+        no_result.append(path)
+    elif s != 0:
+        print "Unexpected exit status %d" % s
 
-if fail and len(tests) != 1:
-    if len(fail) == 1:
-        str = "test"
-    else:
-        str = "%d tests" % len(fail)
-    print "\nFailed the following %s:" % str
-    print "\t", string.join(fail, "\n\t")
+if len(tests) != 1:
+    if fail:
+        if len(fail) == 1:
+            str = "test"
+        else:
+            str = "%d tests" % len(fail)
+        print "\nFailed the following %s:" % str
+        print "\t", string.join(fail, "\n\t")
+    if no_result:
+        if len(no_result) == 1:
+            str = "test"
+        else:
+            str = "%d tests" % len(no_result)
+        print "\nNO RESULT from the following %s:" % str
+        print "\t", string.join(no_result, "\n\t")
 
-sys.exit(len(fail))
+sys.exit(len(fail) + len(no_result))

src/engine/SCons/Defaults.py

     access the registry or appropriate registry keys not found.
     """
        
-    if not _can_read_reg:
+    if not SCons.Util.can_read_reg:
         raise InternalError, "No Windows registry module was found"
 
     if path=='lib':
             # so fall back to a reasonable default:
             MVSdir = r'C:\Program Files\Microsoft Visual Studio'
             MVSVCdir = r'%s\VC98' % MVSdir
+            MVSCommondir = r'%s\Common' % MVSdir
             ConstructionEnvironment = make_win32_env_from_paths(
                 r'%s\atl\include;%s\mfc\include;%s\include' % (MVSVCdir, MVSVCdir, MVSVCdir),
                 r'%s\mvc\lib;%s\lib' % (MVSVCdir, MVSVCdir),
-        	os.environ["PATH"])
+                (r'%s\MSDev98\Bin' % MVSCommondir) + os.pathsep + os.environ["PATH"])
 
 __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
 
 import os
+import os.path
 import string
 import sys
 import TestSCons
 else:
     _exe = ''
 
+lex = None
+for dir in string.split(os.environ['PATH'], os.pathsep):
+    l = os.path.join(dir, 'lex' + _exe)
+    if os.path.exists(l):
+        lex = l
+        break
+
 test = TestSCons.TestSCons()
 
+test.no_result(not lex)
+
 test.write("wrapper.py",
 """import os
 import string
 __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
 
 import os
+import os.path
 import string
 import sys
 import TestSCons
 else:
     _exe = ''
 
+lex = None
+for dir in string.split(os.environ['PATH'], os.pathsep):
+    l = os.path.join(dir, 'lex' + _exe)
+    if os.path.exists(l):
+        lex = l
+        break
+
 test = TestSCons.TestSCons()
 
+test.no_result(not lex)
+
 test.write('SConstruct', """
 foo = Environment()
 bar = Environment(LEXFLAGS = '-b')
 __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
 
 import os
+import os.path
 import string
 import sys
 import TestSCons
 else:
     _exe = ''
 
+yacc = None
+for dir in string.split(os.environ['PATH'], os.pathsep):
+    y = os.path.join(dir, 'yacc' + _exe)
+    if os.path.exists(y):
+        yacc = y
+        break
+
 test = TestSCons.TestSCons()
 
+test.no_result(not yacc)
+
 test.write("wrapper.py",
 """import os
 import string

test/YACCFLAGS.py

 __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
 
 import os
+import os.path
 import string
 import sys
 import TestSCons
 else:
     _exe = ''
 
+yacc = None
+for dir in string.split(os.environ['PATH'], os.pathsep):
+    y = os.path.join(dir, 'yacc' + _exe)
+    if os.path.exists(y):
+        yacc = y
+        break
+
 test = TestSCons.TestSCons()
 
+test.no_result(not yacc)
+
 test.write('SConstruct', """
 foo = Environment()
 bar = Environment(YACCFLAGS = '-v')