Check for the existence of lex and yacc in those tests and bail with NO RESULT if...
authorstevenknight <stevenknight@fdb21ef1-2011-0410-befe-b5e4ea1792b1>
Fri, 11 Jan 2002 03:17:45 +0000 (03:17 +0000)
committerstevenknight <stevenknight@fdb21ef1-2011-0410-befe-b5e4ea1792b1>
Fri, 11 Jan 2002 03:17:45 +0000 (03:17 +0000)
git-svn-id: http://scons.tigris.org/svn/scons/trunk@200 fdb21ef1-2011-0410-befe-b5e4ea1792b1

runtest.py
src/engine/SCons/Defaults.py
test/LEX.py
test/LEXFLAGS.py
test/YACC.py
test/YACCFLAGS.py

index 6ac8a6e7e71f6885701fc8f73c265449952cb374..4535064a1a2d1d5afa0f0931a19adbd2fa42f01e 100644 (file)
@@ -139,6 +139,7 @@ else:
 os.chdir(scons_dir)
 
 fail = []
+no_result = []
 
 for path in tests:
     if os.path.isabs(path):
@@ -148,15 +149,28 @@ for path in tests:
     cmd = string.join(["python", debug, abs], " ")
     if printcmd:
        print cmd
-    if os.system(cmd):
-       fail.append(path)
-
-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")
-
-sys.exit(len(fail))
+    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 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) + len(no_result))
index 056b1f30926b1ab92c4c2103cd1bf8679440b17b..450575c29deca29731707f9e2966c622722b2ca5 100644 (file)
@@ -129,7 +129,7 @@ def get_msvc_path (path, version, platform='x86'):
     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':
@@ -272,8 +272,9 @@ elif os.name == 'nt':
             # 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"])
 
index 9bf37d7167c8d4d174724432274b128776d67c46..38bee992df40c84c9b7b28bd0773b1be10a82a0b 100644 (file)
@@ -25,6 +25,7 @@
 __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
 
 import os
+import os.path
 import string
 import sys
 import TestSCons
@@ -36,8 +37,17 @@ if sys.platform == 'win32':
 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
index 06facb813619d76ea63f33b4c1aff8eaa28fa7ca..2625c29be42769ada0e7c554bb95b3ae92e97c80 100644 (file)
@@ -25,6 +25,7 @@
 __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
 
 import os
+import os.path
 import string
 import sys
 import TestSCons
@@ -36,8 +37,17 @@ if sys.platform == 'win32':
 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')
index f497c6924d1bc45fe4554acc498e2b126a54737c..a4059856245d33822539cecf5b588d0d43d60533 100644 (file)
@@ -25,6 +25,7 @@
 __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
 
 import os
+import os.path
 import string
 import sys
 import TestSCons
@@ -36,8 +37,17 @@ if sys.platform == 'win32':
 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
index dc127ad7ad41d57b4f27d44efde5eea4ab57b79d..82b38cb499cb6ecdcae61195f315c80d5dcc08fc 100644 (file)
@@ -25,6 +25,7 @@
 __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
 
 import os
+import os.path
 import string
 import sys
 import TestSCons
@@ -36,8 +37,17 @@ if sys.platform == 'win32':
 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')