[libc++] Refer to the Filesystem static test env as relative paths

Instead of hardcoding absolute paths on the build-host in the executables,
use relative paths from the current working directory. Also, use
FILE_DEPENDENCIES to mark the static test env as being required by
the relevant tests.

Given a SSH executor that copies the files to the remote host properly,
the tests can be run on that remote host.
This commit is contained in:
Louis Dionne 2020-04-01 16:26:31 -04:00
parent a16ba6fea2
commit a6a841e0d7
40 changed files with 42 additions and 13 deletions

View File

@ -139,9 +139,6 @@ if (LIBCXX_CONFIGURE_IDE)
${LIBCXX_TESTS} ${LIBCXX_TEST_HEADERS} ${LIBCXX_HEADERS})
add_dependencies(libcxx_test_objects cxx)
set(STATIC_ROOT ${LIBCXX_SOURCE_DIR}/test/std/input.output/filesystems/Inputs/static_test_env)
add_definitions(-DLIBCXX_FILESYSTEM_STATIC_TEST_ROOT="${STATIC_ROOT}")
split_list(LIBCXX_COMPILE_FLAGS)
split_list(LIBCXX_LINK_FLAGS)

View File

@ -6,6 +6,7 @@
//
//===----------------------------------------------------------------------===//
// FILE_DEPENDENCIES: ../../Inputs/static_test_env
// UNSUPPORTED: c++98, c++03
// <filesystem>

View File

@ -6,6 +6,7 @@
//
//===----------------------------------------------------------------------===//
// FILE_DEPENDENCIES: ../../Inputs/static_test_env
// UNSUPPORTED: c++98, c++03
// <filesystem>

View File

@ -6,6 +6,7 @@
//
//===----------------------------------------------------------------------===//
// FILE_DEPENDENCIES: ../../Inputs/static_test_env
// UNSUPPORTED: c++98, c++03
// <filesystem>

View File

@ -6,6 +6,7 @@
//
//===----------------------------------------------------------------------===//
// FILE_DEPENDENCIES: ../../Inputs/static_test_env
// UNSUPPORTED: c++98, c++03
// <filesystem>

View File

@ -6,6 +6,7 @@
//
//===----------------------------------------------------------------------===//
// FILE_DEPENDENCIES: ../../Inputs/static_test_env
// UNSUPPORTED: c++98, c++03
// <filesystem>

View File

@ -6,6 +6,7 @@
//
//===----------------------------------------------------------------------===//
// FILE_DEPENDENCIES: ../../Inputs/static_test_env
// UNSUPPORTED: c++98, c++03
// <filesystem>

View File

@ -6,6 +6,7 @@
//
//===----------------------------------------------------------------------===//
// FILE_DEPENDENCIES: ../../Inputs/static_test_env
// UNSUPPORTED: c++98, c++03
// <filesystem>

View File

@ -6,6 +6,7 @@
//
//===----------------------------------------------------------------------===//
// FILE_DEPENDENCIES: ../../Inputs/static_test_env
// UNSUPPORTED: c++98, c++03
// <filesystem>

View File

@ -6,6 +6,7 @@
//
//===----------------------------------------------------------------------===//
// FILE_DEPENDENCIES: ../../Inputs/static_test_env
// UNSUPPORTED: c++98, c++03
// <filesystem>

View File

@ -6,6 +6,7 @@
//
//===----------------------------------------------------------------------===//
// FILE_DEPENDENCIES: ../../Inputs/static_test_env
// UNSUPPORTED: c++98, c++03
// <filesystem>

View File

@ -6,6 +6,7 @@
//
//===----------------------------------------------------------------------===//
// FILE_DEPENDENCIES: ../../Inputs/static_test_env
// UNSUPPORTED: c++98, c++03
// <filesystem>

View File

@ -6,6 +6,7 @@
//
//===----------------------------------------------------------------------===//
// FILE_DEPENDENCIES: ../../Inputs/static_test_env
// UNSUPPORTED: c++98, c++03
// <filesystem>

View File

@ -6,6 +6,7 @@
//
//===----------------------------------------------------------------------===//
// FILE_DEPENDENCIES: ../../Inputs/static_test_env
// UNSUPPORTED: c++98, c++03
// <filesystem>

View File

@ -6,6 +6,7 @@
//
//===----------------------------------------------------------------------===//
// FILE_DEPENDENCIES: ../../Inputs/static_test_env
// UNSUPPORTED: c++98, c++03
// <filesystem>

View File

@ -6,6 +6,7 @@
//
//===----------------------------------------------------------------------===//
// FILE_DEPENDENCIES: ../../Inputs/static_test_env
// UNSUPPORTED: c++98, c++03
// <filesystem>

View File

@ -6,6 +6,7 @@
//
//===----------------------------------------------------------------------===//
// FILE_DEPENDENCIES: ../../Inputs/static_test_env
// UNSUPPORTED: c++98, c++03
// <filesystem>

View File

@ -6,6 +6,7 @@
//
//===----------------------------------------------------------------------===//
// FILE_DEPENDENCIES: ../../Inputs/static_test_env
// UNSUPPORTED: c++98, c++03
// <filesystem>

View File

@ -6,6 +6,7 @@
//
//===----------------------------------------------------------------------===//
// FILE_DEPENDENCIES: ../../Inputs/static_test_env
// UNSUPPORTED: c++98, c++03
// <filesystem>

View File

@ -6,6 +6,7 @@
//
//===----------------------------------------------------------------------===//
// FILE_DEPENDENCIES: ../../Inputs/static_test_env
// UNSUPPORTED: c++98, c++03
// <filesystem>

View File

@ -6,6 +6,7 @@
//
//===----------------------------------------------------------------------===//
// FILE_DEPENDENCIES: ../../Inputs/static_test_env
// UNSUPPORTED: c++98, c++03
// <filesystem>

View File

@ -6,6 +6,7 @@
//
//===----------------------------------------------------------------------===//
// FILE_DEPENDENCIES: ../../Inputs/static_test_env
// UNSUPPORTED: c++98, c++03
// <filesystem>

View File

@ -6,6 +6,7 @@
//
//===----------------------------------------------------------------------===//
// FILE_DEPENDENCIES: ../../Inputs/static_test_env
// UNSUPPORTED: c++98, c++03
// <filesystem>

View File

@ -6,6 +6,7 @@
//
//===----------------------------------------------------------------------===//
// FILE_DEPENDENCIES: ../../Inputs/static_test_env
// UNSUPPORTED: c++98, c++03
// <filesystem>

View File

@ -6,6 +6,7 @@
//
//===----------------------------------------------------------------------===//
// FILE_DEPENDENCIES: ../../Inputs/static_test_env
// UNSUPPORTED: c++98, c++03
// <filesystem>

View File

@ -6,6 +6,7 @@
//
//===----------------------------------------------------------------------===//
// FILE_DEPENDENCIES: ../../Inputs/static_test_env
// UNSUPPORTED: c++98, c++03
// <filesystem>

View File

@ -6,6 +6,7 @@
//
//===----------------------------------------------------------------------===//
// FILE_DEPENDENCIES: ../../Inputs/static_test_env
// UNSUPPORTED: c++98, c++03
// <filesystem>

View File

@ -6,6 +6,7 @@
//
//===----------------------------------------------------------------------===//
// FILE_DEPENDENCIES: ../../Inputs/static_test_env
// UNSUPPORTED: c++98, c++03
// <filesystem>

View File

@ -6,6 +6,7 @@
//
//===----------------------------------------------------------------------===//
// FILE_DEPENDENCIES: ../../Inputs/static_test_env
// UNSUPPORTED: c++98, c++03
// <filesystem>

View File

@ -6,6 +6,7 @@
//
//===----------------------------------------------------------------------===//
// FILE_DEPENDENCIES: ../../Inputs/static_test_env
// UNSUPPORTED: c++98, c++03
// <filesystem>

View File

@ -6,6 +6,7 @@
//
//===----------------------------------------------------------------------===//
// FILE_DEPENDENCIES: ../../Inputs/static_test_env
// UNSUPPORTED: c++98, c++03
// <filesystem>

View File

@ -6,6 +6,7 @@
//
//===----------------------------------------------------------------------===//
// FILE_DEPENDENCIES: ../../Inputs/static_test_env
// UNSUPPORTED: c++98, c++03
// <filesystem>

View File

@ -6,6 +6,7 @@
//
//===----------------------------------------------------------------------===//
// FILE_DEPENDENCIES: ../../Inputs/static_test_env
// UNSUPPORTED: c++98, c++03
// <filesystem>

View File

@ -6,6 +6,7 @@
//
//===----------------------------------------------------------------------===//
// FILE_DEPENDENCIES: ../../Inputs/static_test_env
// UNSUPPORTED: c++98, c++03
// <filesystem>

View File

@ -6,6 +6,7 @@
//
//===----------------------------------------------------------------------===//
// FILE_DEPENDENCIES: ../../Inputs/static_test_env
// UNSUPPORTED: c++98, c++03
// <filesystem>

View File

@ -6,6 +6,7 @@
//
//===----------------------------------------------------------------------===//
// FILE_DEPENDENCIES: ../../Inputs/static_test_env
// UNSUPPORTED: c++98, c++03
// <filesystem>

View File

@ -6,6 +6,7 @@
//
//===----------------------------------------------------------------------===//
// FILE_DEPENDENCIES: ../../Inputs/static_test_env
// UNSUPPORTED: c++98, c++03
// <filesystem>

View File

@ -6,6 +6,7 @@
//
//===----------------------------------------------------------------------===//
// FILE_DEPENDENCIES: ../../Inputs/static_test_env
// UNSUPPORTED: c++98, c++03
// <filesystem>

View File

@ -6,6 +6,3 @@ if 'dylib-has-no-filesystem' in config.available_features:
config.unsupported = True
if 'c++filesystem-disabled' in config.available_features:
config.unsupported = True
inputs = os.path.join(os.path.dirname(__file__), 'Inputs', 'static_test_env')
config.test_format.addCompileFlags(config, '-DLIBCXX_FILESYSTEM_STATIC_TEST_ROOT={}'.format(inputs))

View File

@ -26,13 +26,13 @@
// static test helpers
#ifndef LIBCXX_FILESYSTEM_STATIC_TEST_ROOT
#warning "STATIC TESTS DISABLED"
#else // LIBCXX_FILESYSTEM_STATIC_TEST_ROOT
namespace StaticEnv {
static const fs::path Root = TEST_STRINGIZE(LIBCXX_FILESYSTEM_STATIC_TEST_ROOT);
// Tests that use these utilities should add '<...>/Inputs/static_test_env'
// to their FILE_DEPENDENCIES, to make sure the directory is made available
// to the test. Assuming that, the 'static_test_env' will be available in the
// directory where the test is run.
static const fs::path Root = fs::current_path() / "static_test_env";
inline fs::path makePath(fs::path const& p) {
// env_path is expected not to contain symlinks.
@ -107,8 +107,6 @@ static const fs::path RecDirFollowSymlinksIterationList[] = {
} // namespace StaticEnv
#endif // LIBCXX_FILESYSTEM_STATIC_TEST_ROOT
namespace random_utils {
inline char to_hex(int ch) {
return ch < 10 ? static_cast<char>('0' + ch)