aboutsummaryrefslogtreecommitdiff
path: root/utils/ABITest
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2009-05-08 23:40:45 +0000
committerDaniel Dunbar <daniel@zuster.org>2009-05-08 23:40:45 +0000
commit484c7cad9bf5caefd3b0912aa778457fd46c2804 (patch)
treed01e4ee4db0557153ba47d7ee434ec807028aa60 /utils/ABITest
parentf04dced71a266c177e636c7f1837ea31bfeba1e0 (diff)
ABITest: Improve test driver marginally, to allow running a specific
test index. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71295 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'utils/ABITest')
-rwxr-xr-xutils/ABITest/ABITestGen.py16
1 files changed, 12 insertions, 4 deletions
diff --git a/utils/ABITest/ABITestGen.py b/utils/ABITest/ABITestGen.py
index 539cc28fff..570d40e8c4 100755
--- a/utils/ABITest/ABITestGen.py
+++ b/utils/ABITest/ABITestGen.py
@@ -44,12 +44,17 @@ class TypePrinter:
if self.outputDriver:
print >>self.outputDriver, '#include <stdio.h>\n'
print >>self.outputDriver, 'int main(int argc, char **argv) {'
+ print >>self.outputDriver, ' int index = -1;'
+ print >>self.outputDriver, ' if (argc > 1) index = atoi(argv[1]);'
def finish(self):
if self.layoutTests:
print >>self.output, 'int main(int argc, char **argv) {'
- for f in self.layoutTests:
- print >>self.output, ' %s();' % f
+ print >>self.output, ' int index = -1;'
+ print >>self.output, ' if (argc > 1) index = atoi(argv[1]);'
+ for i,f in self.layoutTests:
+ print >>self.output, ' if (index == -1 || index == %d)' % i
+ print >>self.output, ' %s();' % f
print >>self.output, ' return 0;'
print >>self.output, '}'
@@ -87,7 +92,7 @@ class TypePrinter:
print >>self.output,'}'
print >>self.output
- self.layoutTests.append(fnName)
+ self.layoutTests.append((i,fnName))
def writeFunction(self, i, FT):
args = ', '.join(['%s arg%d'%(self.getTypeName(t),i) for i,t in enumerate(FT.argTypes)])
@@ -123,7 +128,10 @@ class TypePrinter:
print >>self.output
if self.outputDriver:
- print >>self.outputDriver, ' { extern void test_%s(void); test_%s(); }\n'%(fnName,fnName,)
+ print >>self.outputDriver, ' if (index == -1 || index == %d) {' % i
+ print >>self.outputDriver, ' extern void test_%s(void);' % fnName
+ print >>self.outputDriver, ' test_%s();' % fnName
+ print >>self.outputDriver, ' }'
if self.outputTests:
if self.outputHeader: