| 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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 js1_1 | 49 js1_1 |
| 50 js1_2 | 50 js1_2 |
| 51 js1_3 | 51 js1_3 |
| 52 js1_4 | 52 js1_4 |
| 53 js1_5 | 53 js1_5 |
| 54 """.split() | 54 """.split() |
| 55 | 55 |
| 56 | 56 |
| 57 class MozillaTestCase(test.TestCase): | 57 class MozillaTestCase(test.TestCase): |
| 58 | 58 |
| 59 def __init__(self, filename, path, context, mode, framework): | 59 def __init__(self, filename, path, context, root, mode, framework): |
| 60 super(MozillaTestCase, self).__init__(context, path) | 60 super(MozillaTestCase, self).__init__(context, path) |
| 61 self.filename = filename | 61 self.filename = filename |
| 62 self.mode = mode | 62 self.mode = mode |
| 63 self.framework = framework | 63 self.framework = framework |
| 64 self.root = root |
| 64 | 65 |
| 65 def IsNegative(self): | 66 def IsNegative(self): |
| 66 return self.filename.endswith('-n.js') | 67 return self.filename.endswith('-n.js') |
| 67 | 68 |
| 68 def GetLabel(self): | 69 def GetLabel(self): |
| 69 return "%s mozilla %s" % (self.mode, self.GetName()) | 70 return "%s mozilla %s" % (self.mode, self.GetName()) |
| 70 | 71 |
| 71 def IsFailureOutput(self, output): | 72 def IsFailureOutput(self, output): |
| 72 if output.exit_code != 0: | 73 if output.exit_code != 0: |
| 73 return True | 74 return True |
| 74 return 'FAILED!' in output.stdout | 75 return 'FAILED!' in output.stdout |
| 75 | 76 |
| 76 def GetCommand(self): | 77 def GetCommand(self): |
| 77 result = [self.context.GetVm(self.mode), '--expose-gc'] | 78 result = [self.context.GetVm(self.mode), '--expose-gc', |
| 79 join(self.root, 'mozilla-shell-emulation.js')] |
| 78 result += self.framework | 80 result += self.framework |
| 79 result.append(self.filename) | 81 result.append(self.filename) |
| 80 return result | 82 return result |
| 81 | 83 |
| 82 def GetName(self): | 84 def GetName(self): |
| 83 return self.path[-1] | 85 return self.path[-1] |
| 84 | 86 |
| 85 def GetSource(self): | 87 def GetSource(self): |
| 86 return open(self.filename).read() | 88 return open(self.filename).read() |
| 87 | 89 |
| (...skipping 22 matching lines...) Expand all Loading... |
| 110 script = join(self.root, reduce(join, dir, ''), 'shell.js') | 112 script = join(self.root, reduce(join, dir, ''), 'shell.js') |
| 111 if exists(script): | 113 if exists(script): |
| 112 framework.append(script) | 114 framework.append(script) |
| 113 framework.reverse() | 115 framework.reverse() |
| 114 for file in files: | 116 for file in files: |
| 115 if (not file in FRAMEWORK) and file.endswith('.js'): | 117 if (not file in FRAMEWORK) and file.endswith('.js'): |
| 116 full_path = root_path + [file[:-3]] | 118 full_path = root_path + [file[:-3]] |
| 117 full_path = [x for x in full_path if x != 'data'] | 119 full_path = [x for x in full_path if x != 'data'] |
| 118 if self.Contains(path, full_path): | 120 if self.Contains(path, full_path): |
| 119 test = MozillaTestCase(join(root, file), full_path, self.context, | 121 test = MozillaTestCase(join(root, file), full_path, self.context, |
| 120 mode, framework) | 122 self.root, mode, framework) |
| 121 tests.append(test) | 123 tests.append(test) |
| 122 return tests | 124 return tests |
| 123 | 125 |
| 124 def GetBuildRequirements(self): | 126 def GetBuildRequirements(self): |
| 125 return ['sample', 'sample=shell'] | 127 return ['sample', 'sample=shell'] |
| 126 | 128 |
| 127 def GetTestStatus(self, sections, defs): | 129 def GetTestStatus(self, sections, defs): |
| 128 status_file = join(self.root, 'mozilla.status') | 130 status_file = join(self.root, 'mozilla.status') |
| 129 if exists(status_file): | 131 if exists(status_file): |
| 130 test.ReadConfigurationInto(status_file, sections, defs) | 132 test.ReadConfigurationInto(status_file, sections, defs) |
| 131 | 133 |
| 132 | 134 |
| 133 def GetConfiguration(context, root): | 135 def GetConfiguration(context, root): |
| 134 return MozillaTestConfiguration(context, root) | 136 return MozillaTestConfiguration(context, root) |
| OLD | NEW |