OLD | NEW |
1 # Copyright 2012 the V8 project authors. All rights reserved. | 1 # Copyright 2012 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 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 self.sender_lock.release() | 86 self.sender_lock.release() |
87 | 87 |
88 | 88 |
89 def Execute(workspace, ctx, tests, sock, server): | 89 def Execute(workspace, ctx, tests, sock, server): |
90 suite_paths = utils.GetSuitePaths(os.path.join(workspace, "test")) | 90 suite_paths = utils.GetSuitePaths(os.path.join(workspace, "test")) |
91 suites = [] | 91 suites = [] |
92 for root in suite_paths: | 92 for root in suite_paths: |
93 suite = testsuite.TestSuite.LoadTestSuite( | 93 suite = testsuite.TestSuite.LoadTestSuite( |
94 os.path.join(workspace, "test", root)) | 94 os.path.join(workspace, "test", root)) |
95 if suite: | 95 if suite: |
| 96 suite.SetupWorkingDirectory() |
96 suites.append(suite) | 97 suites.append(suite) |
97 | 98 |
98 suites_dict = {} | 99 suites_dict = {} |
99 for s in suites: | 100 for s in suites: |
100 suites_dict[s.name] = s | 101 suites_dict[s.name] = s |
101 s.tests = [] | 102 s.tests = [] |
102 for t in tests: | 103 for t in tests: |
103 suite = suites_dict[t.suite] | 104 suite = suites_dict[t.suite] |
104 t.suite = suite | 105 t.suite = suite |
105 suite.tests.append(t) | 106 suite.tests.append(t) |
106 | 107 |
107 suites = [ s for s in suites if len(s.tests) > 0 ] | 108 suites = [ s for s in suites if len(s.tests) > 0 ] |
108 for s in suites: | 109 for s in suites: |
109 s.DownloadData() | 110 s.DownloadData() |
110 | 111 |
111 progress_indicator = EndpointProgress(sock, server, ctx) | 112 progress_indicator = EndpointProgress(sock, server, ctx) |
112 runner = execution.Runner(suites, progress_indicator, ctx) | 113 runner = execution.Runner(suites, progress_indicator, ctx) |
113 try: | 114 try: |
114 runner.Run(server.jobs) | 115 runner.Run(server.jobs) |
115 except IOError, e: | 116 except IOError, e: |
116 if e.errno == 2: | 117 if e.errno == 2: |
117 message = ("File not found: %s, maybe you forgot to 'git add' it?" % | 118 message = ("File not found: %s, maybe you forgot to 'git add' it?" % |
118 e.filename) | 119 e.filename) |
119 else: | 120 else: |
120 message = "%s" % e | 121 message = "%s" % e |
121 compression.Send([[-1, message]], sock) | 122 compression.Send([[-1, message]], sock) |
122 progress_indicator.HasRun(None, None) # Sentinel to signal the end. | 123 progress_indicator.HasRun(None, None) # Sentinel to signal the end. |
123 progress_indicator.sender_lock.acquire() # Released when sending is done. | 124 progress_indicator.sender_lock.acquire() # Released when sending is done. |
124 progress_indicator.sender_lock.release() | 125 progress_indicator.sender_lock.release() |
OLD | NEW |