OLD | NEW |
1 #!/usr/bin/python | 1 #!/usr/bin/python |
2 | 2 |
3 # Copyright (c) 2011 The Chromium Authors. All rights reserved. | 3 # Copyright (c) 2011 The Chromium Authors. All rights reserved. |
4 # Use of this source code is governed by a BSD-style license that can be | 4 # Use of this source code is governed by a BSD-style license that can be |
5 # found in the LICENSE file. | 5 # found in the LICENSE file. |
6 | 6 |
7 """Dart frog buildbot steps | 7 """Dart frog buildbot steps |
8 | 8 |
9 Runs tests for the frog compiler (running on the vm or the self-hosting version) | 9 Runs tests for the frog compiler (running on the vm or the self-hosting version) |
10 """ | 10 """ |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 return component in ['frogsh', 'frogium', 'legium', 'webdriver'] | 79 return component in ['frogsh', 'frogium', 'legium', 'webdriver'] |
80 | 80 |
81 def TestStep(name, mode, system, component, targets, flags): | 81 def TestStep(name, mode, system, component, targets, flags): |
82 print '@@@BUILD_STEP %s tests: %s %s@@@' % (name, component, ' '.join(flags)) | 82 print '@@@BUILD_STEP %s tests: %s %s@@@' % (name, component, ' '.join(flags)) |
83 sys.stdout.flush() | 83 sys.stdout.flush() |
84 if ComponentsNeedsXterm(component) and system == 'linux': | 84 if ComponentsNeedsXterm(component) and system == 'linux': |
85 cmd = ['xvfb-run', '-a'] | 85 cmd = ['xvfb-run', '-a'] |
86 else: | 86 else: |
87 cmd = [] | 87 cmd = [] |
88 | 88 |
| 89 user_test = os.environ.get('USER_TEST', 'no') |
| 90 |
89 cmd.extend([sys.executable, | 91 cmd.extend([sys.executable, |
90 os.path.join(os.curdir, 'tools', 'test.py'), | 92 os.path.join(os.curdir, 'tools', 'test.py'), |
91 '--mode=' + mode, | 93 '--mode=' + mode, |
92 '--component=' + component, | 94 '--component=' + component, |
93 '--time', | 95 '--time', |
94 '--report', | 96 '--report']) |
95 '--progress=buildbot', | 97 |
96 '-v']) | 98 if user_test == 'yes': |
| 99 cmd.append('--progress=color') |
| 100 else: |
| 101 cmd.extend(['--progress=buildbot', '-v']) |
| 102 |
97 if flags: | 103 if flags: |
98 cmd.extend(flags) | 104 cmd.extend(flags) |
99 cmd.extend(targets) | 105 cmd.extend(targets) |
100 | 106 |
101 print 'running %s' % (' '.join(cmd)) | 107 print 'running %s' % (' '.join(cmd)) |
102 exit_code = subprocess.call(cmd, env=NO_COLOR_ENV) | 108 exit_code = subprocess.call(cmd, env=NO_COLOR_ENV) |
103 if exit_code != 0: | 109 if exit_code != 0: |
104 print '@@@STEP_FAILURE@@@' | 110 print '@@@STEP_FAILURE@@@' |
105 return exit_code | 111 return exit_code |
106 | 112 |
107 | 113 |
108 def BuildFrog(component, mode, system): | 114 def BuildFrog(component, mode, system): |
109 """ build frog. | 115 """ build frog. |
110 Args: | 116 Args: |
111 - component: either 'leg', 'frog', 'frogsh' (frog self-hosted), 'frogium' | 117 - component: either 'dart2js', 'frog', 'frogsh' (frog |
112 or 'legium' | 118 self-hosted), 'frogium' or 'legium' |
113 - mode: either 'debug' or 'release' | 119 - mode: either 'debug' or 'release' |
114 - system: either 'linux', 'mac', or 'win7' | 120 - system: either 'linux', 'mac', or 'win7' |
115 """ | 121 """ |
116 | 122 |
117 os.chdir(DART_PATH) | 123 os.chdir(DART_PATH) |
118 | 124 |
119 print '@@@BUILD_STEP build frog@@@' | 125 print '@@@BUILD_STEP build frog@@@' |
120 | 126 |
121 args = [sys.executable, './tools/build.py', '--mode=' + mode, 'frog'] | 127 args = [sys.executable, './tools/build.py', '--mode=' + mode, 'frog'] |
122 print 'running %s' % (' '.join(args)) | 128 print 'running %s' % (' '.join(args)) |
123 exit_code = subprocess.call(args, env=NO_COLOR_ENV) | 129 exit_code = subprocess.call(args, env=NO_COLOR_ENV) |
124 | 130 |
125 if component == 'dart2js': | 131 if component == 'dart2js': |
126 return exit_code | 132 return exit_code |
127 | 133 |
128 args = [sys.executable, './tools/build.py', '--mode=' + mode, 'frogsh'] | 134 args = [sys.executable, './tools/build.py', '--mode=' + mode, 'frogsh'] |
129 print 'running %s' % (' '.join(args)) | 135 print 'running %s' % (' '.join(args)) |
130 return subprocess.call(args, env=NO_COLOR_ENV) | exit_code | 136 return subprocess.call(args, env=NO_COLOR_ENV) | exit_code |
131 | 137 |
132 | 138 |
133 def TestFrog(component, mode, system, browser, option, flags): | 139 def TestFrog(component, mode, system, browser, option, flags): |
134 """ test frog. | 140 """ test frog. |
135 Args: | 141 Args: |
136 - component: either 'leg', 'frog', 'frogsh' (frog self-hosted), 'frogium', | 142 - component: either 'dart2js', 'frog', 'frogsh' (frog |
137 or 'legium' | 143 self-hosted), 'frogium', or 'legium' |
138 - mode: either 'debug' or 'release' | 144 - mode: either 'debug' or 'release' |
139 - system: either 'linux', 'mac', or 'win7' | 145 - system: either 'linux', 'mac', or 'win7' |
140 - browser: one of the browsers, see GetBuildInfo | 146 - browser: one of the browsers, see GetBuildInfo |
141 - option: 'checked' | 147 - option: 'checked' |
142 - flags: extra flags to pass to test.dart | 148 - flags: extra flags to pass to test.dart |
143 """ | 149 """ |
144 | 150 |
145 # Make sure we are in the frog directory | 151 # Make sure we are in the frog directory |
146 os.chdir(DART_PATH) | 152 os.chdir(DART_PATH) |
147 | 153 |
148 if component == 'dart2js': | 154 if component == 'dart2js': |
149 if (option == 'checked'): | 155 if (option == 'checked'): |
150 flags.append('--host-checked') | 156 flags.append('--host-checked') |
151 # Leg isn't self-hosted (yet) so we run the leg unit tests on the VM. | 157 # Leg isn't self-hosted (yet) so we run the leg unit tests on the VM. |
152 TestStep("leg_extra", mode, system, 'vm', ['leg'], ['--checked']) | 158 TestStep("dart2js_unit", mode, system, 'vm', ['leg'], ['--checked']) |
153 | 159 |
154 extra_suites = ['leg_only', 'frog_native'] | 160 extra_suites = ['leg_only', 'frog_native'] |
155 TestStep("leg_extra", mode, system, 'leg', extra_suites, flags) | 161 TestStep("dart2js_extra", mode, system, 'dart2js', extra_suites, flags) |
156 | 162 |
157 TestStep("leg", mode, system, 'leg', [], flags) | 163 TestStep("dart2js", mode, system, 'dart2js', [], flags) |
158 | 164 |
159 elif component != 'frogium': # frog and frogsh | 165 elif component != 'frogium': # frog and frogsh |
160 TestStep("frog", mode, system, component, [], flags) | 166 TestStep("frog", mode, system, component, [], flags) |
161 TestStep("frog_extra", mode, system, | 167 TestStep("frog_extra", mode, system, |
162 component, ['frog', 'frog_native', 'peg', 'css'], flags) | 168 component, ['frog', 'frog_native', 'peg', 'css'], flags) |
163 TestStep("sdk", mode, system, | 169 TestStep("sdk", mode, system, |
164 'vm', ['dartdoc'], flags) | 170 'vm', ['dartdoc'], flags) |
165 | 171 |
166 else: | 172 else: |
167 tests = ['client', 'language', 'corelib', 'isolate', 'frog', | 173 tests = ['client', 'language', 'corelib', 'isolate', 'frog', |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
257 if status != 0: | 263 if status != 0: |
258 print '@@@STEP_FAILURE@@@' | 264 print '@@@STEP_FAILURE@@@' |
259 | 265 |
260 if component == 'frogium': | 266 if component == 'frogium': |
261 CleanUpTemporaryFiles(system, browser) | 267 CleanUpTemporaryFiles(system, browser) |
262 return status | 268 return status |
263 | 269 |
264 | 270 |
265 if __name__ == '__main__': | 271 if __name__ == '__main__': |
266 sys.exit(main()) | 272 sys.exit(main()) |
OLD | NEW |