Skip to content

Commit a6a841e

Browse files
committed
[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.
1 parent a16ba6f commit a6a841e

File tree

40 files changed

+42
-13
lines changed

40 files changed

+42
-13
lines changed

libcxx/test/CMakeLists.txt

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -139,9 +139,6 @@ if (LIBCXX_CONFIGURE_IDE)
139139
${LIBCXX_TESTS} ${LIBCXX_TEST_HEADERS} ${LIBCXX_HEADERS})
140140
add_dependencies(libcxx_test_objects cxx)
141141

142-
set(STATIC_ROOT ${LIBCXX_SOURCE_DIR}/test/std/input.output/filesystems/Inputs/static_test_env)
143-
add_definitions(-DLIBCXX_FILESYSTEM_STATIC_TEST_ROOT="${STATIC_ROOT}")
144-
145142
split_list(LIBCXX_COMPILE_FLAGS)
146143
split_list(LIBCXX_LINK_FLAGS)
147144

libcxx/test/std/input.output/filesystems/class.directory_entry/directory_entry.cons/path.pass.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
//
77
//===----------------------------------------------------------------------===//
88

9+
// FILE_DEPENDENCIES: ../../Inputs/static_test_env
910
// UNSUPPORTED: c++98, c++03
1011

1112
// <filesystem>

libcxx/test/std/input.output/filesystems/class.directory_entry/directory_entry.mods/replace_filename.pass.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
//
77
//===----------------------------------------------------------------------===//
88

9+
// FILE_DEPENDENCIES: ../../Inputs/static_test_env
910
// UNSUPPORTED: c++98, c++03
1011

1112
// <filesystem>

libcxx/test/std/input.output/filesystems/class.directory_entry/directory_entry.obs/file_size.pass.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
//
77
//===----------------------------------------------------------------------===//
88

9+
// FILE_DEPENDENCIES: ../../Inputs/static_test_env
910
// UNSUPPORTED: c++98, c++03
1011

1112
// <filesystem>

libcxx/test/std/input.output/filesystems/class.directory_entry/directory_entry.obs/hard_link_count.pass.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
//
77
//===----------------------------------------------------------------------===//
88

9+
// FILE_DEPENDENCIES: ../../Inputs/static_test_env
910
// UNSUPPORTED: c++98, c++03
1011

1112
// <filesystem>

libcxx/test/std/input.output/filesystems/class.directory_entry/directory_entry.obs/last_write_time.pass.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
//
77
//===----------------------------------------------------------------------===//
88

9+
// FILE_DEPENDENCIES: ../../Inputs/static_test_env
910
// UNSUPPORTED: c++98, c++03
1011

1112
// <filesystem>

libcxx/test/std/input.output/filesystems/class.directory_iterator/directory_iterator.members/copy.pass.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
//
77
//===----------------------------------------------------------------------===//
88

9+
// FILE_DEPENDENCIES: ../../Inputs/static_test_env
910
// UNSUPPORTED: c++98, c++03
1011

1112
// <filesystem>

libcxx/test/std/input.output/filesystems/class.directory_iterator/directory_iterator.members/copy_assign.pass.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
//
77
//===----------------------------------------------------------------------===//
88

9+
// FILE_DEPENDENCIES: ../../Inputs/static_test_env
910
// UNSUPPORTED: c++98, c++03
1011

1112
// <filesystem>

libcxx/test/std/input.output/filesystems/class.directory_iterator/directory_iterator.members/ctor.pass.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
//
77
//===----------------------------------------------------------------------===//
88

9+
// FILE_DEPENDENCIES: ../../Inputs/static_test_env
910
// UNSUPPORTED: c++98, c++03
1011

1112
// <filesystem>

libcxx/test/std/input.output/filesystems/class.directory_iterator/directory_iterator.members/increment.pass.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
//
77
//===----------------------------------------------------------------------===//
88

9+
// FILE_DEPENDENCIES: ../../Inputs/static_test_env
910
// UNSUPPORTED: c++98, c++03
1011

1112
// <filesystem>

libcxx/test/std/input.output/filesystems/class.directory_iterator/directory_iterator.members/move.pass.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
//
77
//===----------------------------------------------------------------------===//
88

9+
// FILE_DEPENDENCIES: ../../Inputs/static_test_env
910
// UNSUPPORTED: c++98, c++03
1011

1112
// <filesystem>

libcxx/test/std/input.output/filesystems/class.directory_iterator/directory_iterator.members/move_assign.pass.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
//
77
//===----------------------------------------------------------------------===//
88

9+
// FILE_DEPENDENCIES: ../../Inputs/static_test_env
910
// UNSUPPORTED: c++98, c++03
1011

1112
// <filesystem>

libcxx/test/std/input.output/filesystems/class.directory_iterator/directory_iterator.nonmembers/begin_end.pass.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
//
77
//===----------------------------------------------------------------------===//
88

9+
// FILE_DEPENDENCIES: ../../Inputs/static_test_env
910
// UNSUPPORTED: c++98, c++03
1011

1112
// <filesystem>

libcxx/test/std/input.output/filesystems/class.rec.dir.itr/rec.dir.itr.members/copy.pass.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
//
77
//===----------------------------------------------------------------------===//
88

9+
// FILE_DEPENDENCIES: ../../Inputs/static_test_env
910
// UNSUPPORTED: c++98, c++03
1011

1112
// <filesystem>

libcxx/test/std/input.output/filesystems/class.rec.dir.itr/rec.dir.itr.members/copy_assign.pass.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
//
77
//===----------------------------------------------------------------------===//
88

9+
// FILE_DEPENDENCIES: ../../Inputs/static_test_env
910
// UNSUPPORTED: c++98, c++03
1011

1112
// <filesystem>

libcxx/test/std/input.output/filesystems/class.rec.dir.itr/rec.dir.itr.members/ctor.pass.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
//
77
//===----------------------------------------------------------------------===//
88

9+
// FILE_DEPENDENCIES: ../../Inputs/static_test_env
910
// UNSUPPORTED: c++98, c++03
1011

1112
// <filesystem>

libcxx/test/std/input.output/filesystems/class.rec.dir.itr/rec.dir.itr.members/depth.pass.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
//
77
//===----------------------------------------------------------------------===//
88

9+
// FILE_DEPENDENCIES: ../../Inputs/static_test_env
910
// UNSUPPORTED: c++98, c++03
1011

1112
// <filesystem>

libcxx/test/std/input.output/filesystems/class.rec.dir.itr/rec.dir.itr.members/disable_recursion_pending.pass.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
//
77
//===----------------------------------------------------------------------===//
88

9+
// FILE_DEPENDENCIES: ../../Inputs/static_test_env
910
// UNSUPPORTED: c++98, c++03
1011

1112
// <filesystem>

libcxx/test/std/input.output/filesystems/class.rec.dir.itr/rec.dir.itr.members/increment.pass.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
//
77
//===----------------------------------------------------------------------===//
88

9+
// FILE_DEPENDENCIES: ../../Inputs/static_test_env
910
// UNSUPPORTED: c++98, c++03
1011

1112
// <filesystem>

libcxx/test/std/input.output/filesystems/class.rec.dir.itr/rec.dir.itr.members/move.pass.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
//
77
//===----------------------------------------------------------------------===//
88

9+
// FILE_DEPENDENCIES: ../../Inputs/static_test_env
910
// UNSUPPORTED: c++98, c++03
1011

1112
// <filesystem>

libcxx/test/std/input.output/filesystems/class.rec.dir.itr/rec.dir.itr.members/move_assign.pass.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
//
77
//===----------------------------------------------------------------------===//
88

9+
// FILE_DEPENDENCIES: ../../Inputs/static_test_env
910
// UNSUPPORTED: c++98, c++03
1011

1112
// <filesystem>

libcxx/test/std/input.output/filesystems/class.rec.dir.itr/rec.dir.itr.members/pop.pass.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
//
77
//===----------------------------------------------------------------------===//
88

9+
// FILE_DEPENDENCIES: ../../Inputs/static_test_env
910
// UNSUPPORTED: c++98, c++03
1011

1112
// <filesystem>

libcxx/test/std/input.output/filesystems/class.rec.dir.itr/rec.dir.itr.members/recursion_pending.pass.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
//
77
//===----------------------------------------------------------------------===//
88

9+
// FILE_DEPENDENCIES: ../../Inputs/static_test_env
910
// UNSUPPORTED: c++98, c++03
1011

1112
// <filesystem>

libcxx/test/std/input.output/filesystems/class.rec.dir.itr/rec.dir.itr.nonmembers/begin_end.pass.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
//
77
//===----------------------------------------------------------------------===//
88

9+
// FILE_DEPENDENCIES: ../../Inputs/static_test_env
910
// UNSUPPORTED: c++98, c++03
1011

1112
// <filesystem>

libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.canonical/canonical.pass.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
//
77
//===----------------------------------------------------------------------===//
88

9+
// FILE_DEPENDENCIES: ../../Inputs/static_test_env
910
// UNSUPPORTED: c++98, c++03
1011

1112
// <filesystem>

libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.current_path/current_path.pass.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
//
77
//===----------------------------------------------------------------------===//
88

9+
// FILE_DEPENDENCIES: ../../Inputs/static_test_env
910
// UNSUPPORTED: c++98, c++03
1011

1112
// <filesystem>

libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.equivalent/equivalent.pass.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
//
77
//===----------------------------------------------------------------------===//
88

9+
// FILE_DEPENDENCIES: ../../Inputs/static_test_env
910
// UNSUPPORTED: c++98, c++03
1011

1112
// <filesystem>

libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.file_size/file_size.pass.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
//
77
//===----------------------------------------------------------------------===//
88

9+
// FILE_DEPENDENCIES: ../../Inputs/static_test_env
910
// UNSUPPORTED: c++98, c++03
1011

1112
// <filesystem>

libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.hard_lk_ct/hard_link_count.pass.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
//
77
//===----------------------------------------------------------------------===//
88

9+
// FILE_DEPENDENCIES: ../../Inputs/static_test_env
910
// UNSUPPORTED: c++98, c++03
1011

1112
// <filesystem>

libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.is_directory/is_directory.pass.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
//
77
//===----------------------------------------------------------------------===//
88

9+
// FILE_DEPENDENCIES: ../../Inputs/static_test_env
910
// UNSUPPORTED: c++98, c++03
1011

1112
// <filesystem>

libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.is_empty/is_empty.pass.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
//
77
//===----------------------------------------------------------------------===//
88

9+
// FILE_DEPENDENCIES: ../../Inputs/static_test_env
910
// UNSUPPORTED: c++98, c++03
1011

1112
// <filesystem>

libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.is_symlink/is_symlink.pass.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
//
77
//===----------------------------------------------------------------------===//
88

9+
// FILE_DEPENDENCIES: ../../Inputs/static_test_env
910
// UNSUPPORTED: c++98, c++03
1011

1112
// <filesystem>

libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.last_write_time/last_write_time.pass.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
//
77
//===----------------------------------------------------------------------===//
88

9+
// FILE_DEPENDENCIES: ../../Inputs/static_test_env
910
// UNSUPPORTED: c++98, c++03
1011

1112
// <filesystem>

libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.relative/relative.pass.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
//
77
//===----------------------------------------------------------------------===//
88

9+
// FILE_DEPENDENCIES: ../../Inputs/static_test_env
910
// UNSUPPORTED: c++98, c++03
1011

1112
// <filesystem>

libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.space/space.pass.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
//
77
//===----------------------------------------------------------------------===//
88

9+
// FILE_DEPENDENCIES: ../../Inputs/static_test_env
910
// UNSUPPORTED: c++98, c++03
1011

1112
// <filesystem>

libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.status/status.pass.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
//
77
//===----------------------------------------------------------------------===//
88

9+
// FILE_DEPENDENCIES: ../../Inputs/static_test_env
910
// UNSUPPORTED: c++98, c++03
1011

1112
// <filesystem>

libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.symlink_status/symlink_status.pass.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
//
77
//===----------------------------------------------------------------------===//
88

9+
// FILE_DEPENDENCIES: ../../Inputs/static_test_env
910
// UNSUPPORTED: c++98, c++03
1011

1112
// <filesystem>

libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.weakly_canonical/weakly_canonical.pass.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
//
77
//===----------------------------------------------------------------------===//
88

9+
// FILE_DEPENDENCIES: ../../Inputs/static_test_env
910
// UNSUPPORTED: c++98, c++03
1011

1112
// <filesystem>

libcxx/test/std/input.output/filesystems/lit.local.cfg

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,3 @@ if 'dylib-has-no-filesystem' in config.available_features:
66
config.unsupported = True
77
if 'c++filesystem-disabled' in config.available_features:
88
config.unsupported = True
9-
10-
inputs = os.path.join(os.path.dirname(__file__), 'Inputs', 'static_test_env')
11-
config.test_format.addCompileFlags(config, '-DLIBCXX_FILESYSTEM_STATIC_TEST_ROOT={}'.format(inputs))

libcxx/test/support/filesystem_test_helper.h

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,13 @@
2626

2727
// static test helpers
2828

29-
#ifndef LIBCXX_FILESYSTEM_STATIC_TEST_ROOT
30-
#warning "STATIC TESTS DISABLED"
31-
#else // LIBCXX_FILESYSTEM_STATIC_TEST_ROOT
32-
3329
namespace StaticEnv {
3430

35-
static const fs::path Root = TEST_STRINGIZE(LIBCXX_FILESYSTEM_STATIC_TEST_ROOT);
31+
// Tests that use these utilities should add '<...>/Inputs/static_test_env'
32+
// to their FILE_DEPENDENCIES, to make sure the directory is made available
33+
// to the test. Assuming that, the 'static_test_env' will be available in the
34+
// directory where the test is run.
35+
static const fs::path Root = fs::current_path() / "static_test_env";
3636

3737
inline fs::path makePath(fs::path const& p) {
3838
// env_path is expected not to contain symlinks.
@@ -107,8 +107,6 @@ static const fs::path RecDirFollowSymlinksIterationList[] = {
107107

108108
} // namespace StaticEnv
109109

110-
#endif // LIBCXX_FILESYSTEM_STATIC_TEST_ROOT
111-
112110
namespace random_utils {
113111
inline char to_hex(int ch) {
114112
return ch < 10 ? static_cast<char>('0' + ch)

0 commit comments

Comments
 (0)