Automatically pick up the list of tools from the tool directory rather
authorgregnoel <gregnoel@fdb21ef1-2011-0410-befe-b5e4ea1792b1>
Sun, 10 May 2009 00:58:21 +0000 (00:58 +0000)
committergregnoel <gregnoel@fdb21ef1-2011-0410-befe-b5e4ea1792b1>
Sun, 10 May 2009 00:58:21 +0000 (00:58 +0000)
than having a list in the regression test that has to be updated.

git-svn-id: http://scons.tigris.org/svn/scons/trunk@4182 fdb21ef1-2011-0410-befe-b5e4ea1792b1

test/import.py

index c617d0b232c886ee25561c524674c382f0a264bf..ff15e16c63c1c2e318445e002fddbb1642e08bab 100644 (file)
@@ -33,8 +33,10 @@ import os
 import re
 import sys
 
-import TestSCons
+# must do this here, since TestSCons will chdir
+tooldir = os.path.join(os.getcwd(), 'src', 'engine', 'SCons', 'Tool')
 
+import TestSCons
 test = TestSCons.TestSCons()
 
 # Before executing the any of the platform or tool modules, add some
@@ -68,90 +70,23 @@ x = SCons.Platform.%(platform)s.generate
 """ % locals())
     test.run()
 
-tools = [
-    # Can't import '386asm' everywhere due to Windows registry dependency.
-    'aixc++',
-    'aixcc',
-    'aixf77',
-    'aixlink',
-    'applelink',
-    'ar',
-    'as',
-    'bcc32',
-    'BitKeeper',
-    'c++',
-    'cc',
-    'cvf',
-    'CVS',
-    'default',
-    'dmd',
-    'dvi',
-    'dvipdf',
-    'dvips',
-    'f77',
-    'f90',
-    'f95',
-    'fortran',
-    'g++',
-    'g77',
-    'gas',
-    'gcc',
-    'gfortran',
-    'gnulink',
-    'gs',
-    'hpc++',
-    'hpcc',
-    'hplink',
-    'icc',
-    'icl',
-    'ifort',
-    'ifl',
-    'ilink',
-    'ilink32',
-    'intelc',
-    'jar',
-    'javac',
-    'javah',
-    'latex',
-    'lex',
-    'link',
-    # Can't import 'linkloc' everywhere due to Windows registry dependency.
-    'm4',
-    'masm',
-    'midl',
-    'mingw',
-    'mslib',
-    'mslink',
-    'msvc',
-    'msvs',
-    'mwcc',
-    'mwld',
-    'nasm',
-    'pdf',
-    'pdflatex',
-    'pdftex',
-    'Perforce',
-    'qt',
-    'RCS',
-    'rmic',
-    'rpcgen',
-    'SCCS',
-    'sgiar',
-    'sgic++',
-    'sgicc',
-    'sgilink',
-    'Subversion',
-    'sunar',
-    'sunc++',
-    'suncc',
-    'sunlink',
-    'swig',
-    'tar',
-    'tex',
-    'tlib',
-    'yacc',
-    'zip',
-]
+ignore = ('__init__.py',
+        # Can't import these everywhere due to Windows registry dependency.
+        '386asm.py', 'linkloc.py',
+        # Directory of common stuff for MSVC and MSVS
+        'MSCommon',
+        # Sun pkgchk and pkginfo common stuff
+        'sun_pkg.py',
+        )
+tools = []
+for name in os.listdir(tooldir):
+    if name in ignore: continue
+    if name[-3:] == '.py':
+        if name[-8:] not in ('Tests.py', 'ommon.py'):
+            tools.append(name[:-3])
+    elif os.path.exists(os.path.join(tooldir,name,'__init__.py')):
+        tools.append(name)
+tools.sort()    # why not?
 
 #if sys.platform == 'win32':
 # Just comment out (for now?) due to registry dependency.