[libc++] Do not rely on the environment to run filesystem tests
authorLouis Dionne <ldionne@apple.com>
Tue, 24 Mar 2020 21:06:29 +0000 (17:06 -0400)
committerLouis Dionne <ldionne@apple.com>
Tue, 31 Mar 2020 13:03:17 +0000 (09:03 -0400)
commit05bc588abbc38ad1f8f67994ec3bb606f0aaa983
treebe7dfe1b8e8682057a7a6ec8185c5186356dce1f
parent229cda968cb22e2c56fbed8e9ddd4c2495f09757
[libc++] Do not rely on the environment to run filesystem tests

Previously, filesystem tests would require LIBCXX_FILESYSTEM_DYNAMIC_TEST_ROOT
to be present in the environment and to match the value provided when
compiling, as a macro. This has the problem that it only allows for the
filesystem tests to be run on the same machine they are created.

Instead, we create a temporary directory for each test. Technically,
this is tricky to do because we're relying on some of the code that
we're testing to do this. However, there's no other portable way of
creating temporary direcories in C++, so this is difficult to avoid.

Differential Revision: https://reviews.llvm.org/D76731
libcxx/test/CMakeLists.txt
libcxx/test/support/filesystem_dynamic_test_helper.py
libcxx/test/support/filesystem_test_helper.h
libcxx/utils/libcxx/test/config.py