[libcxx] r273323 - Allow the libc++ build/source paths to contain symlinks.

Eric Fiselier via cfe-commits cfe-commits at lists.llvm.org
Tue Jun 21 14:54:23 PDT 2016


Author: ericwf
Date: Tue Jun 21 16:54:23 2016
New Revision: 273323

URL: http://llvm.org/viewvc/llvm-project?rev=273323&view=rev
Log:
Allow the libc++ build/source paths to contain symlinks.

The filesystem tests were expecting the paths to the build/source directories
did not contain any symlinks. This patch resolves those symlinks before running
the test suite.


Modified:
    libcxx/trunk/test/libcxx/test/config.py
    libcxx/trunk/test/support/filesystem_test_helper.hpp

Modified: libcxx/trunk/test/libcxx/test/config.py
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/libcxx/test/config.py?rev=273323&r1=273322&r2=273323&view=diff
==============================================================================
--- libcxx/trunk/test/libcxx/test/config.py (original)
+++ libcxx/trunk/test/libcxx/test/config.py Tue Jun 21 16:54:23 2016
@@ -439,11 +439,13 @@ class Configuration(object):
         self.config.available_features.add('c++filesystem')
         static_env = os.path.join(self.libcxx_src_root, 'test', 'std',
                                   'experimental', 'filesystem', 'Inputs', 'static_test_env')
+        static_env = os.path.realpath(static_env)
         assert os.path.isdir(static_env)
         self.cxx.compile_flags += ['-DLIBCXX_FILESYSTEM_STATIC_TEST_ROOT="%s"' % static_env]
 
         dynamic_env = os.path.join(self.libcxx_obj_root, 'test',
                                    'filesystem', 'Output', 'dynamic_env')
+        dynamic_env = os.path.realpath(dynamic_env)
         if not os.path.isdir(dynamic_env):
             os.makedirs(dynamic_env)
         self.cxx.compile_flags += ['-DLIBCXX_FILESYSTEM_DYNAMIC_TEST_ROOT="%s"' % dynamic_env]

Modified: libcxx/trunk/test/support/filesystem_test_helper.hpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/support/filesystem_test_helper.hpp?rev=273323&r1=273322&r2=273323&view=diff
==============================================================================
--- libcxx/trunk/test/support/filesystem_test_helper.hpp (original)
+++ libcxx/trunk/test/support/filesystem_test_helper.hpp Tue Jun 21 16:54:23 2016
@@ -20,6 +20,7 @@ namespace fs = std::experimental::filesy
 namespace StaticEnv {
 
 inline fs::path makePath(fs::path const& p) {
+    // env_path is expected not to contain symlinks.
     static const fs::path env_path = LIBCXX_FILESYSTEM_STATIC_TEST_ROOT;
     return env_path / p;
 }
@@ -236,6 +237,7 @@ private:
     }
 
     static bool checkDynamicTestRoot() {
+        // LIBCXX_FILESYSTEM_DYNAMIC_TEST_ROOT is expected not to contain symlinks.
         char* fs_root = std::getenv("LIBCXX_FILESYSTEM_DYNAMIC_TEST_ROOT");
         if (!fs_root) {
             std::printf("ERROR: LIBCXX_FILESYSTEM_DYNAMIC_TEST_ROOT must be a defined "




More information about the cfe-commits mailing list