[libcxx-commits] [libcxx] eeb96e4 - [libc++] Re-apply parts of 3ea9450bda90 "Migrate Lit platform detection to the DSL"
Louis Dionne via libcxx-commits
libcxx-commits at lists.llvm.org
Mon Jun 15 14:40:56 PDT 2020
Author: Louis Dionne
Date: 2020-06-15T17:40:04-04:00
New Revision: eeb96e4f198a9e212f82a5dd067e3c1af6e5876f
URL: https://github.com/llvm/llvm-project/commit/eeb96e4f198a9e212f82a5dd067e3c1af6e5876f
DIFF: https://github.com/llvm/llvm-project/commit/eeb96e4f198a9e212f82a5dd067e3c1af6e5876f.diff
LOG: [libc++] Re-apply parts of 3ea9450bda90 "Migrate Lit platform detection to the DSL"
The commit was reverted in 43c4afb56ff0 because it broke the Windows to
Linux cross-compilation build bots. The issue turned out to be that the
bots were setting the LIBCXX_EXECUTOR incorrectly. This has been fixed
now and verified with the bot owners.
Note that this is only a partial re-application of the commit, since
non-problematic parts of the commits have already been re-applied earlier.
Added:
Modified:
libcxx/utils/libcxx/test/config.py
libcxx/utils/libcxx/test/features.py
libcxx/utils/libcxx/test/target_info.py
Removed:
################################################################################
diff --git a/libcxx/utils/libcxx/test/config.py b/libcxx/utils/libcxx/test/config.py
index 44cb95943877..41c0b084393d 100644
--- a/libcxx/utils/libcxx/test/config.py
+++ b/libcxx/utils/libcxx/test/config.py
@@ -317,9 +317,6 @@ def configure_features(self):
self.config.available_features.add('availability=%s' % name)
self.config.available_features.add('availability=%s%s' % (name, version))
- # Insert the platform name and version into the available features.
- self.target_info.add_platform_features(self.config.available_features)
-
# Simulator testing can take a really long time for some of these tests
# so add a feature check so we can REQUIRES: long_tests in them
self.long_tests = self.get_lit_bool('long_tests')
@@ -333,7 +330,6 @@ def configure_features(self):
self.config.available_features.add('long_tests')
if self.target_info.is_windows():
- self.config.available_features.add('windows')
if self.cxx_stdlib_under_test == 'libc++':
# LIBCXX-WINDOWS-FIXME is the feature name used to XFAIL the
# initial Windows failures until they can be properly diagnosed
diff --git a/libcxx/utils/libcxx/test/features.py b/libcxx/utils/libcxx/test/features.py
index d00866df9aaa..5229cf67b959 100644
--- a/libcxx/utils/libcxx/test/features.py
+++ b/libcxx/utils/libcxx/test/features.py
@@ -108,3 +108,24 @@
Feature(name='locale.{}'.format(locale),
when=lambda cfg: any(hasLocale(cfg, alt) for alt in alts))
]
+
+
+# Add a feature representing the platform name: darwin, linux, windows, etc...
+features += [
+ Feature(name=lambda cfg: programOutput(cfg, """
+ #include <cstdio>
+ int main() {
+ #if defined(__APPLE__)
+ std::printf("darwin");
+ #elif defined(_WIN32)
+ std::printf("windows");
+ #elif defined(__NetBSD__)
+ std::printf("netbsd");
+ #elif defined(__linux__)
+ std::printf("linux");
+ #else
+ std::printf("unknown-platform");
+ #endif
+ }
+ """))
+]
diff --git a/libcxx/utils/libcxx/test/target_info.py b/libcxx/utils/libcxx/test/target_info.py
index adc704890efd..5782fc53dca0 100644
--- a/libcxx/utils/libcxx/test/target_info.py
+++ b/libcxx/utils/libcxx/test/target_info.py
@@ -35,9 +35,6 @@ def add_cxx_link_flags(self, flags): pass
def allow_cxxabi_link(self): return True
def use_lit_shell_default(self): return False
- def add_platform_features(self, features):
- features.add(self.platform())
-
def add_path(self, dest_env, new_path):
if not new_path:
return
@@ -168,19 +165,6 @@ def platform_ver(self):
ver = ver.lower().strip().replace(' ', '-')
return ver # Permitted to be None.
- def add_platform_features(self, features):
- super(LinuxLocalTI, self).add_platform_features(features)
-
- # Some linux distributions have
diff erent locale data than others.
- # Insert the distributions name and name-version into the available
- # features to allow tests to XFAIL on them.
- name = self.platform_name()
- ver = self.platform_ver()
- if name:
- features.add(name)
- if name and ver:
- features.add('%s-%s' % (name, ver))
-
def add_cxx_compile_flags(self, flags):
flags += ['-D__STDC_FORMAT_MACROS',
'-D__STDC_LIMIT_MACROS',
More information about the libcxx-commits
mailing list