[llvm-commits] [dragonegg] r153054 - in /dragonegg/trunk/test: DEFormats.py DETestRunner.py DEUtils.py compilator/dragonegg-lit.cfg
Duncan Sands
baldrick at free.fr
Mon Mar 19 13:51:50 PDT 2012
Author: baldrick
Date: Mon Mar 19 15:51:49 2012
New Revision: 153054
URL: http://llvm.org/viewvc/llvm-project?rev=153054&view=rev
Log:
Base special flags on the language rather than on the suffix.
Modified:
dragonegg/trunk/test/DEFormats.py
dragonegg/trunk/test/DETestRunner.py
dragonegg/trunk/test/DEUtils.py
dragonegg/trunk/test/compilator/dragonegg-lit.cfg
Modified: dragonegg/trunk/test/DEFormats.py
URL: http://llvm.org/viewvc/llvm-project/dragonegg/trunk/test/DEFormats.py?rev=153054&r1=153053&r2=153054&view=diff
==============================================================================
--- dragonegg/trunk/test/DEFormats.py (original)
+++ dragonegg/trunk/test/DEFormats.py Mon Mar 19 15:51:49 2012
@@ -2,14 +2,14 @@
from TestFormats import FileBasedTest
class CompilatorTest(FileBasedTest):
- def __init__(self, compilers, compiler_flags, suffix_flags, skip, xfails):
+ def __init__(self, compilers, compiler_flags, language_flags, skip, xfails):
self.compilers = compilers
self.compiler_flags = compiler_flags
- self.suffix_flags = suffix_flags
+ self.language_flags = language_flags
self.skip = skip
self.xfails = xfails
def execute(self, test, litConfig):
return DETestRunner.executeCompilatorTest(test, litConfig,
- self.compilers, self.compiler_flags, self.suffix_flags, self.skip,
+ self.compilers, self.compiler_flags, self.language_flags, self.skip,
self.xfails)
Modified: dragonegg/trunk/test/DETestRunner.py
URL: http://llvm.org/viewvc/llvm-project/dragonegg/trunk/test/DETestRunner.py?rev=153054&r1=153053&r2=153054&view=diff
==============================================================================
--- dragonegg/trunk/test/DETestRunner.py (original)
+++ dragonegg/trunk/test/DETestRunner.py Mon Mar 19 15:51:49 2012
@@ -3,6 +3,7 @@
import Test
import TestRunner
import Util
+import DEUtils
def describeFailure(output, cmd, out, err, exitCode):
print >>output, "Command:",
@@ -48,7 +49,7 @@
return (Test.FAIL, output.getvalue())
-def executeCompilatorTest(test, litConfig, compilers, flags, suffix_flags,
+def executeCompilatorTest(test, litConfig, compilers, flags, language_flags,
skip, xfails):
test_path = '/'.join(test.path_in_suite)
@@ -76,8 +77,9 @@
# Add any file specific flags.
srcBase,srcExt = os.path.splitext(srcPath)
- if srcExt in suffix_flags:
- common_args += suffix_flags[srcExt]
+ language = DEUtils.getLanguageForSuffix(srcExt)
+ if language in language_flags:
+ common_args += language_flags[language]
# Compile the test.
for args in flags:
Modified: dragonegg/trunk/test/DEUtils.py
URL: http://llvm.org/viewvc/llvm-project/dragonegg/trunk/test/DEUtils.py?rev=153054&r1=153053&r2=153054&view=diff
==============================================================================
--- dragonegg/trunk/test/DEUtils.py (original)
+++ dragonegg/trunk/test/DEUtils.py Mon Mar 19 15:51:49 2012
@@ -24,6 +24,9 @@
'.mm' : 'objc++',
}
+def getLanguageForSuffix(suffix):
+ return suffixMap[suffix]
+
def getSuffixesForLanguage(language):
suffixes = []
for suffix in suffixMap:
Modified: dragonegg/trunk/test/compilator/dragonegg-lit.cfg
URL: http://llvm.org/viewvc/llvm-project/dragonegg/trunk/test/compilator/dragonegg-lit.cfg?rev=153054&r1=153053&r2=153054&view=diff
==============================================================================
--- dragonegg/trunk/test/compilator/dragonegg-lit.cfg (original)
+++ dragonegg/trunk/test/compilator/dragonegg-lit.cfg Mon Mar 19 15:51:49 2012
@@ -19,9 +19,8 @@
for language in config.gcc_languages.split(','):
config.suffixes = config.suffixes + DEUtils.getSuffixesForLanguage(language)
-config.suffix_flags = {
- '.jar' : ['-fuse-boehm-gc'], # Otherwise gcc crashes
- '.class' : ['-fuse-boehm-gc'] # Otherwise gcc crashes
+config.language_flags = {
+ 'java' : ['-fuse-boehm-gc'] # Otherwise gcc crashes
}
config.compilers = [
@@ -476,4 +475,4 @@
# testFormat: The test format to use to interpret tests.
config.test_format = DEFormats.CompilatorTest(config.compilers,
- config.compiler_flags, config.suffix_flags, config.skip, config.xfails)
+ config.compiler_flags, config.language_flags, config.skip, config.xfails)
More information about the llvm-commits
mailing list