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 <jwak...@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