annotate libcxxabi/test/lit.cfg @ 192:d7606dcf6fce

Added tag llvm10 for changeset 0572611fdcc8
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Mon, 14 Dec 2020 18:01:34 +0900
parents 0572611fdcc8
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
150
anatofuz
parents:
diff changeset
1 # -*- Python -*- vim: set ft=python ts=4 sw=4 expandtab tw=79:
anatofuz
parents:
diff changeset
2
anatofuz
parents:
diff changeset
3 # Configuration file for the 'lit' test runner.
anatofuz
parents:
diff changeset
4
anatofuz
parents:
diff changeset
5
anatofuz
parents:
diff changeset
6 import os
anatofuz
parents:
diff changeset
7 import site
anatofuz
parents:
diff changeset
8
anatofuz
parents:
diff changeset
9 site.addsitedir(os.path.dirname(__file__))
anatofuz
parents:
diff changeset
10
anatofuz
parents:
diff changeset
11
anatofuz
parents:
diff changeset
12 # Tell pylint that we know config and lit_config exist somewhere.
anatofuz
parents:
diff changeset
13 if 'PYLINT_IMPORT' in os.environ:
anatofuz
parents:
diff changeset
14 config = object()
anatofuz
parents:
diff changeset
15 lit_config = object()
anatofuz
parents:
diff changeset
16
anatofuz
parents:
diff changeset
17 # name: The name of this test suite.
anatofuz
parents:
diff changeset
18 config.name = 'libc++abi'
anatofuz
parents:
diff changeset
19
anatofuz
parents:
diff changeset
20 # suffixes: A list of file extensions to treat as test files.
anatofuz
parents:
diff changeset
21 config.suffixes = ['.cpp', '.s']
anatofuz
parents:
diff changeset
22
173
0572611fdcc8 reorgnization done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
23 # Allow expanding substitutions that are based on other substitutions
0572611fdcc8 reorgnization done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
24 config.recursiveExpansionLimit = 10
0572611fdcc8 reorgnization done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
25
150
anatofuz
parents:
diff changeset
26 # test_source_root: The root path where tests are located.
anatofuz
parents:
diff changeset
27 config.test_source_root = os.path.dirname(__file__)
anatofuz
parents:
diff changeset
28
173
0572611fdcc8 reorgnization done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
29 # Allow expanding substitutions that are based on other substitutions
0572611fdcc8 reorgnization done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
30 config.recursiveExpansionLimit = 10
0572611fdcc8 reorgnization done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
31
150
anatofuz
parents:
diff changeset
32 # Infer the libcxx_test_source_root for configuration import.
anatofuz
parents:
diff changeset
33 # If libcxx_source_root isn't specified in the config, assume that the libcxx
anatofuz
parents:
diff changeset
34 # and libcxxabi source directories are sibling directories.
anatofuz
parents:
diff changeset
35 libcxx_src_root = getattr(config, 'libcxx_src_root', None)
anatofuz
parents:
diff changeset
36 if not libcxx_src_root:
anatofuz
parents:
diff changeset
37 libcxx_src_root = os.path.join(config.test_source_root, '../../libcxx')
anatofuz
parents:
diff changeset
38 libcxx_test_src_root = os.path.join(libcxx_src_root, 'utils')
anatofuz
parents:
diff changeset
39 if os.path.isfile(os.path.join(libcxx_test_src_root, 'libcxx', '__init__.py')):
anatofuz
parents:
diff changeset
40 site.addsitedir(libcxx_test_src_root)
anatofuz
parents:
diff changeset
41 else:
anatofuz
parents:
diff changeset
42 lit_config.fatal('Could not find libcxx test directory for test imports'
anatofuz
parents:
diff changeset
43 ' in: %s' % libcxx_test_src_root)
anatofuz
parents:
diff changeset
44
anatofuz
parents:
diff changeset
45 # Infer the test_exec_root from the libcxx_object root.
anatofuz
parents:
diff changeset
46 obj_root = getattr(config, 'libcxxabi_obj_root', None)
anatofuz
parents:
diff changeset
47
anatofuz
parents:
diff changeset
48 # Check that the test exec root is known.
anatofuz
parents:
diff changeset
49 if obj_root is None:
anatofuz
parents:
diff changeset
50 import libcxx.test.config
anatofuz
parents:
diff changeset
51 libcxx.test.config.loadSiteConfig(
anatofuz
parents:
diff changeset
52 lit_config, config, 'libcxxabi_site_config', 'LIBCXXABI_SITE_CONFIG')
anatofuz
parents:
diff changeset
53 obj_root = getattr(config, 'libcxxabi_obj_root', None)
anatofuz
parents:
diff changeset
54 if obj_root is None:
anatofuz
parents:
diff changeset
55 import tempfile
anatofuz
parents:
diff changeset
56 obj_root = tempfile.mkdtemp(prefix='libcxxabi-testsuite-')
anatofuz
parents:
diff changeset
57 lit_config.warning('Creating temporary directory for object root: %s' %
anatofuz
parents:
diff changeset
58 obj_root)
anatofuz
parents:
diff changeset
59
anatofuz
parents:
diff changeset
60 config.test_exec_root = os.path.join(obj_root, 'test')
anatofuz
parents:
diff changeset
61
anatofuz
parents:
diff changeset
62 cfg_variant = getattr(config, 'configuration_variant', 'libcxxabi')
anatofuz
parents:
diff changeset
63 if cfg_variant:
anatofuz
parents:
diff changeset
64 lit_config.note('Using configuration variant: %s' % cfg_variant)
anatofuz
parents:
diff changeset
65
anatofuz
parents:
diff changeset
66 # Load the Configuration class from the module name <cfg_variant>.test.config.
anatofuz
parents:
diff changeset
67 config_module_name = '.'.join([cfg_variant, 'test', 'config'])
anatofuz
parents:
diff changeset
68 config_module = __import__(config_module_name, fromlist=['Configuration'])
anatofuz
parents:
diff changeset
69
anatofuz
parents:
diff changeset
70 configuration = config_module.Configuration(lit_config, config)
anatofuz
parents:
diff changeset
71 configuration.configure()
anatofuz
parents:
diff changeset
72 configuration.print_config_info()
173
0572611fdcc8 reorgnization done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
73 if lit_config.params.get('use_old_format', False):
0572611fdcc8 reorgnization done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
74 lit_config.note("Using the old libc++ testing format")
0572611fdcc8 reorgnization done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
75 config.test_format = configuration.get_test_format()
0572611fdcc8 reorgnization done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
76 else:
0572611fdcc8 reorgnization done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
77 lit_config.note("Using the new libc++ testing format")
0572611fdcc8 reorgnization done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
78 import libcxx.test.newformat
0572611fdcc8 reorgnization done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
79 config.test_format = libcxx.test.newformat.CxxStandardLibraryTest()