| 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 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 90 class MessageTestConfiguration(test.TestConfiguration): | 90 class MessageTestConfiguration(test.TestConfiguration): |
| 91 | 91 |
| 92 def __init__(self, context, root): | 92 def __init__(self, context, root): |
| 93 super(MessageTestConfiguration, self).__init__(context, root) | 93 super(MessageTestConfiguration, self).__init__(context, root) |
| 94 | 94 |
| 95 def Ls(self, path): | 95 def Ls(self, path): |
| 96 return [f[:-3] for f in os.listdir(path) if f.endswith('.js')] | 96 return [f[:-3] for f in os.listdir(path) if f.endswith('.js')] |
| 97 | 97 |
| 98 def ListTests(self, current_path, path, mode): | 98 def ListTests(self, current_path, path, mode): |
| 99 mjsunit = [current_path + [t] for t in self.Ls(self.root)] | 99 mjsunit = [current_path + [t] for t in self.Ls(self.root)] |
| 100 regress = [current_path + ['regress', t] for t in self.Ls(join(self.root, 'r
egress'))] |
| 100 bugs = [current_path + ['bugs', t] for t in self.Ls(join(self.root, 'bugs'))
] | 101 bugs = [current_path + ['bugs', t] for t in self.Ls(join(self.root, 'bugs'))
] |
| 101 all_tests = mjsunit + bugs | 102 all_tests = mjsunit + regress + bugs |
| 102 result = [] | 103 result = [] |
| 103 for test in all_tests: | 104 for test in all_tests: |
| 104 if self.Contains(path, test): | 105 if self.Contains(path, test): |
| 105 file_prefix = join(self.root, reduce(join, test[1:], "")) | 106 file_prefix = join(self.root, reduce(join, test[1:], "")) |
| 106 file_path = file_prefix + ".js" | 107 file_path = file_prefix + ".js" |
| 107 output_path = file_prefix + ".out" | 108 output_path = file_prefix + ".out" |
| 108 if not exists(output_path): | 109 if not exists(output_path): |
| 109 print "Could not find %s" % output_path | 110 print "Could not find %s" % output_path |
| 110 continue | 111 continue |
| 111 result.append(MessageTestCase(test, file_path, output_path, mode, | 112 result.append(MessageTestCase(test, file_path, output_path, mode, |
| 112 self.context, self)) | 113 self.context, self)) |
| 113 return result | 114 return result |
| 114 | 115 |
| 115 def GetBuildRequirements(self): | 116 def GetBuildRequirements(self): |
| 116 return ['sample', 'sample=shell'] | 117 return ['sample', 'sample=shell'] |
| 117 | 118 |
| 118 def GetTestStatus(self, sections, defs): | 119 def GetTestStatus(self, sections, defs): |
| 119 status_file = join(self.root, 'message.status') | 120 status_file = join(self.root, 'message.status') |
| 120 if exists(status_file): | 121 if exists(status_file): |
| 121 test.ReadConfigurationInto(status_file, sections, defs) | 122 test.ReadConfigurationInto(status_file, sections, defs) |
| 122 | 123 |
| 123 | 124 |
| 124 def GetConfiguration(context, root): | 125 def GetConfiguration(context, root): |
| 125 return MessageTestConfiguration(context, root) | 126 return MessageTestConfiguration(context, root) |
| OLD | NEW |