[llvm-commits] CVS: llvm/test/QMTest/llvmdb.py

John Criswell criswell at cs.uiuc.edu
Tue Oct 7 14:15:01 PDT 2003


Changes in directory llvm/test/QMTest:

llvmdb.py updated: 1.4 -> 1.5

---
Log message:

Added the magic to make the Feature tests work.
Feature tests now appear as 'Feature.fxx.yyyy' where xx is the test type and
yyyy is the name of the test.
Removed the opaquetypes test for now.



---
Diffs of the changes:  (+45 -5)

Index: llvm/test/QMTest/llvmdb.py
diff -u llvm/test/QMTest/llvmdb.py:1.4 llvm/test/QMTest/llvmdb.py:1.5
--- llvm/test/QMTest/llvmdb.py:1.4	Fri Oct  3 16:03:05 2003
+++ llvm/test/QMTest/llvmdb.py	Tue Oct  7 14:13:56 2003
@@ -60,11 +60,22 @@
 	#
 	def GetTest (self, test_id):
 		#
+		# Determine if this is a feature test.  If so, massage the pathname
+		# a little bit.
+		#
+		(headlabel, label) = self.SplitLabelLeft (test_id)
+		if (headlabel == 'Feature'):
+			(featuretypelabel, testlabel) = self.SplitLabelLeft (label)
+			testlabel = headlabel + '.' + testlabel
+		else:
+			testlabel = test_id
+
+		#
 		# Try to figure out whether this test exists or not.
 		#
 		exts=['ll', 'llx', 'c', 'cpp', 'td', 'c.tr', 'cpp.tr']
 
-		testpath = self.dbpath + '/' + self.LabelToPath (test_id)
+		testpath = self.dbpath + '/' + self.LabelToPath (testlabel)
 		for ext in exts:
 			if (os.path.exists (testpath + '.' + ext)):
 				break
@@ -74,11 +85,26 @@
 		#
 		# Construct the pathname of the test relative to the LLVM source tree.
 		#
-		testpath = 'test/' + self.LabelToPath (test_id) + '.' + ext
+		testpath = 'test/' + self.LabelToPath (testlabel) + '.' + ext
+
+		#
+		# If the test is a feature test, create the appropraite test for it.
+		#
+		if (headlabel == 'Feature'):
+			if (featuretypelabel == 'fopt'):
+				return qm.test.database.TestDescriptor(self, test_id, 'llvm.TestOptimizer', {'srcfile':testpath})
+			if (featuretypelabel == 'fasm'):
+				return qm.test.database.TestDescriptor(self, test_id, 'llvm.AssemblyCodeTest', {'srcfile':testpath})
+			if (featuretypelabel == 'fmc'):
+				return qm.test.database.TestDescriptor(self, test_id, 'llvm.MachineCodeTest', {'srcfile':testpath})
+			if (featuretypelabel == 'fcc'):
+				return qm.test.database.TestDescriptor(self, test_id, 'llvm.ConvertToCTest', {'srcfile':testpath})
+			if (featuretypelabel == 'fad'):
+				return qm.test.database.TestDescriptor(self, test_id, 'llvm.TestAsmDisasm', {'srcfile':testpath})
 
 		#
 		# If the file ends in .llx or .tr, then it is a TestRunner (as opposed
-		# to # HomeStar Runner) test.
+		# to HomeStar Runner) test.
 		#
 		if ((ext == 'llx') or (ext == 'c.tr') or (ext == 'cpp.tr')):
 			return qm.test.database.TestDescriptor(self, test_id, 'llvm.TestRunner', {'srcfile':testpath})
@@ -110,6 +136,20 @@
 	#		files = A list of files within this directory.
 	#
 	def GetDirsAndFiles (self, dirpath):
+
+		# The list of feature directories
+		featuredirs = ['fopt', 'fasm', 'fmc', 'fcc', 'fad']
+
+		#
+		# To perform magic on the Feature tests, adjust the pathname.
+		#
+		if (os.path.basename (dirpath) == 'Feature'):
+			return (featuredirs, [])
+
+		for x in featuredirs:
+			if (x == os.path.basename (dirpath)):
+				dirpath = os.path.dirname (dirpath)
+
 		#
 		# Get a list of the tests located in this directory.
 		#
@@ -119,9 +159,9 @@
 		# Record names of invalid directories and files.
 		#
 		invalid_dirs = ['CVS', 'QMTest', 'QMTestDB', 'Scripts', 'Programs',
-		                'Feature', 'Fragments']
+		                'Fragments']
 
-		invalid_files = ['Makefile', 'README.txt', '.cvsignore']
+		invalid_files = ['Makefile', 'README.txt', '.cvsignore', 'opaquetypes.ll']
 
 		#
 		# Start with an empty list of files and directories.





More information about the llvm-commits mailing list