~doanac/lava-test/stream-md5

« back to all changes in this revision

Viewing changes to abrek/testdef.py

  • Committer: Paul Larson
  • Date: 2010-10-18 17:10:46 UTC
  • mfrom: (37.3.3 x11perf)
  • Revision ID: paul.larson@canonical.com-20101018171046-gvm9tqdcdzioptqg
Add x11perf test and also ad a fixids method to the parser that changes
spaces to _ and removes illegal characters from the test_case_id, until
dashboard can handle this.

Show diffs side-by-side

added added

removed removed

Lines of Context:
280
280
            self.fixresults(self.fixupdict)
281
281
        if self.appendall:
282
282
            self.appendtoall(self.appendall)
 
283
        self.fixids()
283
284
 
284
285
    def append(self, testid, entry):
285
286
        """Appends a dict to the test_results entry for a specified testid
310
311
            if t.has_key("result"):
311
312
                t['result'] = fixupdict[t['result']]
312
313
 
 
314
    def fixids(self):
 
315
        """
 
316
        Convert spaces to _ in test_case_id and remove illegal characters
 
317
        """
 
318
        badchars = "[^a-zA-Z0-9_-]"
 
319
        for id in self.results['test_results']:
 
320
            if id.has_key('test_case_id'):
 
321
                id['test_case_id'] = id['test_case_id'].replace(" ", "_")
 
322
                id['test_case_id'] = re.sub(badchars, "", id['test_case_id'])
 
323
 
313
324
 
314
325
def testloader(testname):
315
326
    """