aboutsummaryrefslogtreecommitdiff
path: root/lib/ubsan/lit_tests/lit.common.cfg
blob: 23c85e9fa0659d38fac30fc10e52e4f088ed8092 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# -*- Python -*-

import os

def get_required_attr(config, attr_name):
  attr_value = getattr(config, attr_name, None)
  if not attr_value:
    lit_config.fatal(
      "No attribute %r in test configuration! You may need to run "
      "tests from your build directory or add this attribute "
      "to lit.site.cfg " % attr_name)
  return attr_value

# Setup source root.
ubsan_lit_tests_dir = get_required_attr(config, 'ubsan_lit_tests_dir')
config.test_source_root = os.path.join(ubsan_lit_tests_dir, 'TestCases')

def DisplayNoConfigMessage():
  lit_config.fatal("No site specific configuration available! " +
                   "Try running your test from the build tree or running " +
                   "make check-ubsan")

# Default test suffixes.
config.suffixes = ['.c', '.cc', '.cpp']

# UndefinedBehaviorSanitizer tests are currently supported on
# Linux and Darwin only.
if config.host_os not in ['Linux', 'Darwin']:
  config.unsupported = True

config.pipefail = False