This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
[v3 patch] Fix FAIL in experimental/filesystem/operations/current_path.cc
- From: Jonathan Wakely <jwakely at redhat dot com>
- To: libstdc++ at gcc dot gnu dot org, gcc-patches at gcc dot gnu dot org
- Date: Thu, 30 Jul 2015 13:40:48 +0100
- Subject: [v3 patch] Fix FAIL in experimental/filesystem/operations/current_path.cc
- Authentication-results: sourceware.org; auth=none
This test is failing on Darwin, it turns out to be because TMPDIR is
set to a symlink, so after changing to that directory current_path()
returns a different path. We should canonicalize the paths before
comparing them.
Tested x86_64-linux, committed to trunk.
commit 4948553fcf04e6d3255d6c440bfc82aac71cfbe3
Author: Jonathan Wakely <jwakely@redhat.com>
Date: Thu Jul 30 13:32:15 2015 +0100
* testsuite/experimental/filesystem/operations/current_path.cc: Use
canonical paths for comparisons.
diff --git a/libstdc++-v3/testsuite/experimental/filesystem/operations/current_path.cc b/libstdc++-v3/testsuite/experimental/filesystem/operations/current_path.cc
index 325a5a8..c242ac0 100644
--- a/libstdc++-v3/testsuite/experimental/filesystem/operations/current_path.cc
+++ b/libstdc++-v3/testsuite/experimental/filesystem/operations/current_path.cc
@@ -42,11 +42,11 @@ test02()
auto oldwd = fs::current_path();
auto tmpdir = fs::temp_directory_path();
current_path(tmpdir);
- VERIFY( fs::current_path() == tmpdir );
+ VERIFY( canonical(fs::current_path()) == canonical(tmpdir) );
std::error_code ec;
current_path(oldwd, ec);
- VERIFY( fs::current_path() == oldwd );
- VERIFY( fs::current_path(ec) == oldwd );
+ VERIFY( canonical(fs::current_path()) == canonical(oldwd) );
+ VERIFY( canonical(fs::current_path(ec)) == canonical(oldwd) );
}
int