Alexey Samsonov | 5e43cfa | 2013-11-14 12:30:09 +0000 | [diff] [blame] | 1 | # -*- Python -*- |
| 2 | |
| 3 | import os |
| 4 | |
| 5 | def get_required_attr(config, attr_name): |
| 6 | attr_value = getattr(config, attr_name, None) |
| 7 | if not attr_value: |
| 8 | lit_config.fatal( |
| 9 | "No attribute %r in test configuration! You may need to run " |
| 10 | "tests from your build directory or add this attribute " |
| 11 | "to lit.site.cfg " % attr_name) |
| 12 | return attr_value |
| 13 | |
| 14 | # Setup source root. |
| 15 | ubsan_lit_tests_dir = get_required_attr(config, 'ubsan_lit_tests_dir') |
| 16 | config.test_source_root = os.path.join(ubsan_lit_tests_dir, 'TestCases') |
| 17 | |
| 18 | def DisplayNoConfigMessage(): |
| 19 | lit_config.fatal("No site specific configuration available! " + |
| 20 | "Try running your test from the build tree or running " + |
| 21 | "make check-ubsan") |
| 22 | |
| 23 | # Default test suffixes. |
| 24 | config.suffixes = ['.c', '.cc', '.cpp'] |
| 25 | |
| 26 | # UndefinedBehaviorSanitizer tests are currently supported on |
| 27 | # Linux and Darwin only. |
| 28 | if config.host_os not in ['Linux', 'Darwin']: |
| 29 | config.unsupported = True |
| 30 | |
| 31 | config.pipefail = False |