| OLD | NEW |
| 1 #!/usr/bin/python | 1 #!/usr/bin/python |
| 2 # Copyright (c) 2013 The Native Client Authors. All rights reserved. | 2 # Copyright (c) 2013 The Native Client 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 """This script runs the LLVM regression tests and the LLVM testsuite. | 6 """This script runs the LLVM regression tests and the LLVM testsuite. |
| 7 These tests are tightly coupled to the LLVM build, and require that | 7 These tests are tightly coupled to the LLVM build, and require that |
| 8 LLVM has been built on this host by build.sh. It also assumes that | 8 LLVM has been built on this host by build.sh. It also assumes that |
| 9 the test suite source has been checked out using gclient (build.sh | 9 the test suite source has been checked out using gclient (build.sh |
| 10 git-sync). | 10 git-sync). |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 os.chdir(curdir) | 49 os.chdir(curdir) |
| 50 | 50 |
| 51 | 51 |
| 52 def ParseCommandLine(argv): | 52 def ParseCommandLine(argv): |
| 53 usage = """%prog [options] | 53 usage = """%prog [options] |
| 54 | 54 |
| 55 Specify the tests or test subsets in the options; common tests are | 55 Specify the tests or test subsets in the options; common tests are |
| 56 --llvm-regression and --testsuite-all. | 56 --llvm-regression and --testsuite-all. |
| 57 | 57 |
| 58 The --opt arguments control the frontend/backend optimization flags. | 58 The --opt arguments control the frontend/backend optimization flags. |
| 59 The default set is {O3f,O2b}, other options are {O0f,O0b}. | 59 The default set is {O3f,O2b}, other options are {O0f,O0b,O2b_sz,O0b_sz}. |
| 60 """ | 60 """ |
| 61 parser = optparse.OptionParser(usage=usage) | 61 parser = optparse.OptionParser(usage=usage) |
| 62 parser.add_option('--arch', dest='arch', | 62 parser.add_option('--arch', dest='arch', |
| 63 help=('Architecture to test, e.g. x86-32, x86-64, arm; ' + | 63 help=('Architecture to test, e.g. x86-32, x86-64, arm; ' + |
| 64 'required for most tests')) | 64 'required for most tests')) |
| 65 parser.add_option('--opt', dest='opt_attributes', action='append', | 65 parser.add_option('--opt', dest='opt_attributes', action='append', |
| 66 default=[], | 66 default=[], |
| 67 help=('Add optimization level attribute of ' + | 67 help=('Add optimization level attribute of ' + |
| 68 'test configuration')) | 68 'test configuration')) |
| 69 parser.add_option('--llvm-regression', dest='run_llvm_regression', | 69 parser.add_option('--llvm-regression', dest='run_llvm_regression', |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 143 A simple dict containing keys 'frontend_opt', 'frontend_attr', | 143 A simple dict containing keys 'frontend_opt', 'frontend_attr', |
| 144 'backend_opt', and 'backend_attr', each mapped to a valid string | 144 'backend_opt', and 'backend_attr', each mapped to a valid string |
| 145 value. The result is a function of the --opt command-line | 145 value. The result is a function of the --opt command-line |
| 146 arguments, with defaults in place when there are too few --opt | 146 arguments, with defaults in place when there are too few --opt |
| 147 arguments. | 147 arguments. |
| 148 """ | 148 """ |
| 149 configs = dict(O0f={'frontend_opt': '-O0', 'frontend_attr': 'O0f'}, | 149 configs = dict(O0f={'frontend_opt': '-O0', 'frontend_attr': 'O0f'}, |
| 150 O3f={'frontend_opt': '-O3', 'frontend_attr': 'O3f'}, | 150 O3f={'frontend_opt': '-O3', 'frontend_attr': 'O3f'}, |
| 151 O0b={'backend_opt': '-translate-fast', | 151 O0b={'backend_opt': '-translate-fast', |
| 152 'backend_attr': 'O0b'}, | 152 'backend_attr': 'O0b'}, |
| 153 O2b={'backend_opt': '-O2', 'backend_attr': 'O2b'}) | 153 O2b={'backend_opt': '-O2', 'backend_attr': 'O2b'}, |
| 154 O0b_sz={'backend_opt': '-translate-fast --use-sz', |
| 155 'backend_attr': 'O0b_sz'}, |
| 156 O2b_sz={'backend_opt': '-O2 --use-sz', |
| 157 'backend_attr': 'O2b_sz'}, |
| 158 ) |
| 154 result = {} | 159 result = {} |
| 155 # Default is pnacl-clang -O3, pnacl-translate -O2 | 160 # Default is pnacl-clang -O3, pnacl-translate -O2 |
| 156 for attr in ['O3f', 'O2b'] + options.opt_attributes: | 161 for attr in ['O3f', 'O2b'] + options.opt_attributes: |
| 157 if attr in configs: | 162 if attr in configs: |
| 158 result.update(configs[attr]) | 163 result.update(configs[attr]) |
| 159 return result | 164 return result |
| 160 | 165 |
| 161 | 166 |
| 162 def GetConfigSuffix(config): | 167 def GetConfigSuffix(config): |
| 163 """Create a string to be used as a file suffix. | 168 """Create a string to be used as a file suffix. |
| (...skipping 355 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 519 EnsureSdkExists(env) | 524 EnsureSdkExists(env) |
| 520 result = result or RunLitTest(env['TC_BUILD_LIBCXX'], 'check-libcxx', | 525 result = result or RunLitTest(env['TC_BUILD_LIBCXX'], 'check-libcxx', |
| 521 'LIBCXX_KNOWN_FAILURES', | 526 'LIBCXX_KNOWN_FAILURES', |
| 522 env, options) | 527 env, options) |
| 523 | 528 |
| 524 result = result or RunTestsuiteSteps(env, config, options) | 529 result = result or RunTestsuiteSteps(env, config, options) |
| 525 return result | 530 return result |
| 526 | 531 |
| 527 if __name__ == '__main__': | 532 if __name__ == '__main__': |
| 528 sys.exit(main(sys.argv)) | 533 sys.exit(main(sys.argv)) |
| OLD | NEW |