Index: test/cctest/testcfg.py |
=================================================================== |
--- test/cctest/testcfg.py (revision 1212) |
+++ test/cctest/testcfg.py (working copy) |
@@ -36,27 +36,37 @@ |
class CcTestCase(test.TestCase): |
- def __init__(self, path, executable, mode, raw_name, context): |
+ def __init__(self, path, executable, mode, raw_name, dependency, context): |
super(CcTestCase, self).__init__(context, path) |
self.executable = executable |
self.mode = mode |
self.raw_name = raw_name |
+ self.dependency = dependency |
def GetLabel(self): |
return "%s %s %s" % (self.mode, self.path[-2], self.path[-1]) |
def GetName(self): |
return self.path[-1] |
- |
- def GetCommand(self): |
+ |
+ def BuildCommand(self, name): |
serialization_file = join('obj', 'test', self.mode, 'serdes') |
serialization_option = '--testing_serialization_file=' + serialization_file |
- result = [ self.executable, self.raw_name, serialization_option ] |
+ result = [ self.executable, name, serialization_option ] |
if self.mode == 'debug': |
result += DEBUG_FLAGS |
return result |
+ def GetCommand(self): |
+ return self.BuildCommand(self.raw_name) |
+ |
+ def Run(self): |
+ if self.dependency != '': |
+ dependent_command = self.BuildCommand(self.dependency) |
+ self.RunCommand(dependent_command) |
Christian Plesner Hansen
2009/02/03 08:21:16
Consider checking that this command didn't fail an
olehougaard
2009/02/03 08:34:26
Done
|
+ return test.TestCase.Run(self) |
+ |
class CcTestConfiguration(test.TestConfiguration): |
def __init__(self, context, root): |
@@ -75,10 +85,14 @@ |
print output.stderr |
return [] |
result = [] |
- for raw_test in output.stdout.strip().split(): |
- full_path = current_path + raw_test.split('/') |
+ for test_desc in output.stdout.strip().split(): |
+ raw_test, dependency = test_desc.split('<') |
+ relative_path = raw_test.split('/') |
+ full_path = current_path + relative_path |
+ if dependency != '': |
+ dependency = relative_path[0] + '/' + dependency |
if self.Contains(path, full_path): |
- result.append(CcTestCase(full_path, executable, mode, raw_test, self.context)) |
+ result.append(CcTestCase(full_path, executable, mode, raw_test, dependency, self.context)) |
return result |
def GetTestStatus(self, sections, defs): |