summaryrefslogtreecommitdiffstats
path: root/test/lit.cfg
diff options
context:
space:
mode:
authorDan Albert <danalbert@google.com>2015-03-04 10:47:52 -0800
committerDan Albert <danalbert@google.com>2015-03-04 10:47:52 -0800
commit5cb52824fc2a0caf233311e91d9a2a53368f04ad (patch)
tree603f9a5b7189f6db8f5b1cbaef56295af6d166bc /test/lit.cfg
parent94962fba20d5830a18f3ce0350d6cf299c04b8aa (diff)
downloadexternal_libcxx-5cb52824fc2a0caf233311e91d9a2a53368f04ad.tar.gz
external_libcxx-5cb52824fc2a0caf233311e91d9a2a53368f04ad.tar.bz2
external_libcxx-5cb52824fc2a0caf233311e91d9a2a53368f04ad.zip
Merge to upstream r231255.
Change-Id: Ia8ee1801b42943464b99f28b6a83647458f3efb5
Diffstat (limited to 'test/lit.cfg')
-rw-r--r--test/lit.cfg41
1 files changed, 16 insertions, 25 deletions
diff --git a/test/lit.cfg b/test/lit.cfg
index 6f536386e..f7fa6144f 100644
--- a/test/lit.cfg
+++ b/test/lit.cfg
@@ -15,41 +15,31 @@ if 'PYLINT_IMPORT' in os.environ:
config.name = 'libc++'
# suffixes: A list of file extensions to treat as test files.
-config.suffixes = ['.cpp']
+config.suffixes = ['.pass.cpp', '.fail.cpp', '.sh.cpp']
# test_source_root: The root path where tests are located.
config.test_source_root = os.path.dirname(__file__)
# Infer the test_exec_root from the libcxx_object root.
-libcxx_obj_root = getattr(config, 'libcxx_obj_root', None)
-if libcxx_obj_root is not None:
- config.test_exec_root = os.path.join(libcxx_obj_root, 'test')
+obj_root = getattr(config, 'libcxx_obj_root', None)
# Check that the test exec root is known.
-if config.test_exec_root is None:
- # Otherwise, we haven't loaded the site specific configuration (the user is
- # probably trying to run on a test file directly, and either the site
- # configuration hasn't been created by the build system, or we are in an
- # out-of-tree build situation).
- site_cfg = lit_config.params.get('libcxx_site_config',
- os.environ.get('LIBCXX_SITE_CONFIG'))
- if not site_cfg:
- lit_config.warning('No site specific configuration file found!'
- ' Running the tests in the default configuration.')
- # TODO: Set test_exec_root to a temporary directory where output files
- # can be placed. This is needed for ShTest.
- elif not os.path.isfile(site_cfg):
- lit_config.fatal(
- "Specified site configuration file does not exist: '%s'" %
- site_cfg)
- else:
- lit_config.note('using site specific configuration at %s' % site_cfg)
- lit_config.load_config(config, site_cfg)
- raise SystemExit()
+if obj_root is None:
+ import libcxx.test.config
+ libcxx.test.config.loadSiteConfig(lit_config, config, 'libcxx_site_config',
+ 'LIBCXX_SITE_CONFIG')
+ obj_root = getattr(config, 'libcxx_obj_root', None)
+ if obj_root is None:
+ import tempfile
+ obj_root = tempfile.mkdtemp(prefix='libcxx-testsuite-')
+ lit_config.warning('Creating temporary directory for object root: %s' %
+ obj_root)
+
+config.test_exec_root = os.path.join(obj_root, 'test')
cfg_variant = getattr(config, 'configuration_variant', 'libcxx')
if cfg_variant:
- print 'Using configuration variant: %s' % cfg_variant
+ lit_config.note('Using configuration variant: %s' % cfg_variant)
# Load the Configuration class from the module name <cfg_variant>.test.config.
config_module_name = '.'.join([cfg_variant, 'test', 'config'])
@@ -57,4 +47,5 @@ config_module = __import__(config_module_name, fromlist=['Configuration'])
configuration = config_module.Configuration(lit_config, config)
configuration.configure()
+configuration.print_config_info()
config.test_format = configuration.get_test_format()