From a2439bebe1c21d23a1b7c43f4bd16865e2664b87 Mon Sep 17 00:00:00 2001 From: Louis Dionne Date: Wed, 10 Jun 2020 08:46:49 -0400 Subject: [PATCH] [libc++] Translate the enable_filesystem parameter to the DSL --- libcxx/utils/ci/macos-backdeployment.sh | 6 ++++++ libcxx/utils/libcxx/test/config.py | 7 ------- libcxx/utils/libcxx/test/params.py | 6 ++++++ 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/libcxx/utils/ci/macos-backdeployment.sh b/libcxx/utils/ci/macos-backdeployment.sh index 4ed3bda..839c613 100755 --- a/libcxx/utils/ci/macos-backdeployment.sh +++ b/libcxx/utils/ci/macos-backdeployment.sh @@ -119,10 +119,16 @@ fi LIBCXX_ROOT_ON_DEPLOYMENT_TARGET="${PREVIOUS_DYLIBS_DIR}/macOS/libc++/${DEPLOYMENT_TARGET}" LIBCXXABI_ROOT_ON_DEPLOYMENT_TARGET="${PREVIOUS_DYLIBS_DIR}/macOS/libc++abi/${DEPLOYMENT_TARGET}" +# Filesystem is supported on Apple platforms starting with macosx10.15. +if [[ ${DEPLOYMENT_TARGET} =~ "^10.9|10.10|10.11|10.12|10.13|10.14$" ]]; then + ENABLE_FILESYSTEM="--param enable_filesystem=False" +fi + # TODO: We need to also run the tests for libc++abi. echo "@@@ Running tests for libc++ @@@" "${LLVM_BUILD_DIR}/bin/llvm-lit" -sv "${MONOREPO_ROOT}/libcxx/test" \ --param=enable_experimental=false \ + ${ENABLE_FILESYSTEM} \ --param=cxx_headers="${LLVM_INSTALL_DIR}/include/c++/v1" \ --param=std="${STD}" \ --param=platform="macosx${DEPLOYMENT_TARGET}" \ diff --git a/libcxx/utils/libcxx/test/config.py b/libcxx/utils/libcxx/test/config.py index ec673da..118cb89 100644 --- a/libcxx/utils/libcxx/test/config.py +++ b/libcxx/utils/libcxx/test/config.py @@ -328,9 +328,6 @@ class Configuration(object): if self.long_tests: self.config.available_features.add('long_tests') - if not self.get_lit_bool('enable_filesystem', default=True): - self.config.available_features.add('c++filesystem-disabled') - if self.target_info.is_windows(): self.config.available_features.add('windows') if self.cxx_stdlib_under_test == 'libc++': @@ -868,10 +865,6 @@ class Configuration(object): self.config.available_features.add('dylib-has-no-bad_any_cast') self.lit_config.note("throwing bad_any_cast is not supported by the deployment target") - # Filesystem is support on Apple platforms starting with macosx10.15. - if name == 'macosx' and version in ('10.%s' % v for v in range(9, 15)): - self.config.available_features.add('c++filesystem-disabled') - self.lit_config.note("the deployment target does not support ") else: self.cxx.compile_flags += ['-D_LIBCPP_DISABLE_AVAILABILITY'] diff --git a/libcxx/utils/libcxx/test/params.py b/libcxx/utils/libcxx/test/params.py index 9a42d74b..43674de 100644 --- a/libcxx/utils/libcxx/test/params.py +++ b/libcxx/utils/libcxx/test/params.py @@ -13,4 +13,10 @@ parameters = [ help="Whether to enable exceptions when compiling the test suite.", feature=lambda exceptions: None if exceptions else Feature(name='no-exceptions', compileFlag='-fno-exceptions')), + + # Parameters to enable or disable parts of the test suite + Parameter(name='enable_filesystem', choices=[True, False], type=bool, default=True, + help="Whether to enable tests for the C++ library.", + feature=lambda filesystem: None if filesystem else + Feature(name='c++filesystem-disabled')), ] -- 2.7.4