blob: 23c85e9fa0659d38fac30fc10e52e4f088ed8092 [file] [log] [blame]
Alexey Samsonov5e43cfa2013-11-14 12:30:09 +00001# -*- Python -*-
2
3import os
4
5def 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.
15ubsan_lit_tests_dir = get_required_attr(config, 'ubsan_lit_tests_dir')
16config.test_source_root = os.path.join(ubsan_lit_tests_dir, 'TestCases')
17
18def 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.
24config.suffixes = ['.c', '.cc', '.cpp']
25
26# UndefinedBehaviorSanitizer tests are currently supported on
27# Linux and Darwin only.
28if config.host_os not in ['Linux', 'Darwin']:
29 config.unsupported = True
30
31config.pipefail = False