| OLD | NEW |
| 1 # Copyright 2008 the V8 project authors. All rights reserved. | 1 # Copyright 2008 the V8 project authors. All rights reserved. |
| 2 # Redistribution and use in source and binary forms, with or without | 2 # Redistribution and use in source and binary forms, with or without |
| 3 # modification, are permitted provided that the following conditions are | 3 # modification, are permitted provided that the following conditions are |
| 4 # met: | 4 # met: |
| 5 # | 5 # |
| 6 # * Redistributions of source code must retain the above copyright | 6 # * Redistributions of source code must retain the above copyright |
| 7 # notice, this list of conditions and the following disclaimer. | 7 # notice, this list of conditions and the following disclaimer. |
| 8 # * Redistributions in binary form must reproduce the above | 8 # * Redistributions in binary form must reproduce the above |
| 9 # copyright notice, this list of conditions and the following | 9 # copyright notice, this list of conditions and the following |
| 10 # disclaimer in the documentation and/or other materials provided | 10 # disclaimer in the documentation and/or other materials provided |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 import os | 30 import os |
| 31 from os.path import join, exists | 31 from os.path import join, exists |
| 32 | 32 |
| 33 | 33 |
| 34 HARNESS_FILES = ['sth.js'] | 34 HARNESS_FILES = ['sth.js'] |
| 35 | 35 |
| 36 | 36 |
| 37 class ES5ConformTestCase(test.TestCase): | 37 class ES5ConformTestCase(test.TestCase): |
| 38 | 38 |
| 39 def __init__(self, filename, path, context, root, mode, framework): | 39 def __init__(self, filename, path, context, root, mode, framework): |
| 40 super(ES5ConformTestCase, self).__init__(context, path) | 40 super(ES5ConformTestCase, self).__init__(context, path, mode) |
| 41 self.filename = filename | 41 self.filename = filename |
| 42 self.mode = mode | |
| 43 self.framework = framework | 42 self.framework = framework |
| 44 self.root = root | 43 self.root = root |
| 45 | 44 |
| 46 def IsNegative(self): | 45 def IsNegative(self): |
| 47 return self.filename.endswith('-n.js') | 46 return self.filename.endswith('-n.js') |
| 48 | 47 |
| 49 def GetLabel(self): | 48 def GetLabel(self): |
| 50 return "%s es5conform %s" % (self.mode, self.GetName()) | 49 return "%s es5conform %s" % (self.mode, self.GetName()) |
| 51 | 50 |
| 52 def IsFailureOutput(self, output): | 51 def IsFailureOutput(self, output): |
| 53 if output.exit_code != 0: | 52 if output.exit_code != 0: |
| 54 return True | 53 return True |
| 55 return 'FAILED!' in output.stdout | 54 return 'FAILED!' in output.stdout |
| 56 | 55 |
| 57 def GetCommand(self): | 56 def GetCommand(self): |
| 58 result = [self.context.GetVm(self.mode)] | 57 result = self.context.GetVmCommand(self, self.mode) |
| 59 result += ['-e', 'var window = this'] | 58 result += ['-e', 'var window = this'] |
| 60 result += self.framework | 59 result += self.framework |
| 61 result.append(self.filename) | 60 result.append(self.filename) |
| 62 result += ['-e', 'ES5Harness.startTesting()'] | 61 result += ['-e', 'ES5Harness.startTesting()'] |
| 63 return result | 62 return result |
| 64 | 63 |
| 65 def GetName(self): | 64 def GetName(self): |
| 66 return self.path[-1] | 65 return self.path[-1] |
| 67 | 66 |
| 68 def GetSource(self): | 67 def GetSource(self): |
| (...skipping 30 matching lines...) Expand all Loading... |
| 99 return ['sample', 'sample=shell'] | 98 return ['sample', 'sample=shell'] |
| 100 | 99 |
| 101 def GetTestStatus(self, sections, defs): | 100 def GetTestStatus(self, sections, defs): |
| 102 status_file = join(self.root, 'es5conform.status') | 101 status_file = join(self.root, 'es5conform.status') |
| 103 if exists(status_file): | 102 if exists(status_file): |
| 104 test.ReadConfigurationInto(status_file, sections, defs) | 103 test.ReadConfigurationInto(status_file, sections, defs) |
| 105 | 104 |
| 106 | 105 |
| 107 def GetConfiguration(context, root): | 106 def GetConfiguration(context, root): |
| 108 return ES5ConformTestConfiguration(context, root) | 107 return ES5ConformTestConfiguration(context, root) |
| OLD | NEW |