Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(44)

Side by Side Diff: tools/nocompile_driver.py

Issue 678263003: Switch to clang for nocompile tests and rebaseline existing results. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Downcasting Pass Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « build/nocompile.gypi ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # Copyright (c) 2011 The Chromium Authors. All rights reserved. 2 # Copyright (c) 2011 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 5
6 """Implements a simple "negative compile" test for C++ on linux. 6 """Implements a simple "negative compile" test for C++ on linux.
7 7
8 Sometimes a C++ API needs to ensure that various usages cannot compile. To 8 Sometimes a C++ API needs to ensure that various usages cannot compile. To
9 enable unittesting of these assertions, we use this python script to 9 enable unittesting of these assertions, we use this python script to
10 invoke gcc on a source file and assert that compilation fails. 10 invoke gcc on a source file and assert that compilation fails.
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after
213 was aborted. If the test completed successfully, 213 was aborted. If the test completed successfully,
214 this value is 0. 214 this value is 0.
215 'finished_at': A timestamp in seconds since the epoch for when this 215 'finished_at': A timestamp in seconds since the epoch for when this
216 test was successfully complete. If the test is aborted, 216 test was successfully complete. If the test is aborted,
217 or running, this value is 0. 217 or running, this value is 0.
218 'expectations': A dictionary with the test expectations. See 218 'expectations': A dictionary with the test expectations. See
219 ParseExpectation() for the structure. 219 ParseExpectation() for the structure.
220 } 220 }
221 """ 221 """
222 # TODO(ajwong): Get the compiler from gyp. 222 # TODO(ajwong): Get the compiler from gyp.
223 cmdline = ['g++'] 223 cmdline = [os.path.join(os.path.dirname(os.path.realpath(__file__)),
224 '../third_party/llvm-build/Release+Asserts/bin',
225 'clang++')]
224 cmdline.extend(shlex.split(cflags)) 226 cmdline.extend(shlex.split(cflags))
225 name = config['name'] 227 name = config['name']
226 expectations = config['expectations'] 228 expectations = config['expectations']
227 if expectations is not None: 229 if expectations is not None:
228 cmdline.append('-D%s' % name) 230 cmdline.append('-D%s' % name)
229 cmdline.extend(['-o', '/dev/null', '-c', '-x', 'c++', sourcefile_path]) 231 cmdline.extend(['-std=c++11', '-o', '/dev/null', '-c', '-x', 'c++',
232 sourcefile_path])
230 233
231 process = subprocess.Popen(cmdline, stdout=subprocess.PIPE, 234 process = subprocess.Popen(cmdline, stdout=subprocess.PIPE,
232 stderr=subprocess.PIPE) 235 stderr=subprocess.PIPE)
233 now = time.time() 236 now = time.time()
234 return {'proc': process, 237 return {'proc': process,
235 'cmdline': ' '.join(cmdline), 238 'cmdline': ' '.join(cmdline),
236 'name': name, 239 'name': name,
237 'suite_name': config['suite_name'], 240 'suite_name': config['suite_name'],
238 'terminate_timeout': now + NCTEST_TERMINATE_TIMEOUT_SEC, 241 'terminate_timeout': now + NCTEST_TERMINATE_TIMEOUT_SEC,
239 'kill_timeout': now + NCTEST_KILL_TIMEOUT_SEC, 242 'kill_timeout': now + NCTEST_KILL_TIMEOUT_SEC,
(...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after
463 timings['results_processed'] = time.time() 466 timings['results_processed'] = time.time()
464 467
465 # We always know at least a sanity test was run. 468 # We always know at least a sanity test was run.
466 WriteStats(resultfile, finished_tests[0]['suite_name'], timings) 469 WriteStats(resultfile, finished_tests[0]['suite_name'], timings)
467 470
468 resultfile.close() 471 resultfile.close()
469 472
470 473
471 if __name__ == '__main__': 474 if __name__ == '__main__':
472 main() 475 main()
OLDNEW
« no previous file with comments | « build/nocompile.gypi ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698