[libcxx] r337991 - Add print statements to help debugging

Eric Fiselier via cfe-commits cfe-commits at lists.llvm.org
Wed Jul 25 18:10:50 PDT 2018


Author: ericwf
Date: Wed Jul 25 18:10:50 2018
New Revision: 337991

URL: http://llvm.org/viewvc/llvm-project?rev=337991&view=rev
Log:
Add print statements to help debugging

Modified:
    libcxx/trunk/test/std/experimental/filesystem/fs.op.funcs/fs.op.last_write_time/last_write_time.pass.cpp

Modified: libcxx/trunk/test/std/experimental/filesystem/fs.op.funcs/fs.op.last_write_time/last_write_time.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/experimental/filesystem/fs.op.funcs/fs.op.last_write_time/last_write_time.pass.cpp?rev=337991&r1=337990&r2=337991&view=diff
==============================================================================
--- libcxx/trunk/test/std/experimental/filesystem/fs.op.funcs/fs.op.last_write_time/last_write_time.pass.cpp (original)
+++ libcxx/trunk/test/std/experimental/filesystem/fs.op.funcs/fs.op.last_write_time/last_write_time.pass.cpp Wed Jul 25 18:10:50 2018
@@ -421,21 +421,23 @@ TEST_CASE(set_last_write_time_dynamic_en
 #endif
 
     struct TestCase {
+      const char * case_name;
       path p;
       file_time_type new_time;
     } cases[] = {
-        {file, epoch_time},
-        {dir, epoch_time},
-        {file, future_time},
-        {dir, future_time},
-        {file, past_time},
-        {dir, past_time},
-        {file, before_epoch_time},
-        {dir, before_epoch_time},
-        {file, just_before_epoch_time},
-        {dir, just_before_epoch_time}
+        {"file, epoch_time", file, epoch_time},
+        {"dir, epoch_time", dir, epoch_time},
+        {"file, future_time", file, future_time},
+        {"dir, future_time", dir, future_time},
+        {"file, past_time", file, past_time},
+        {"dir, past_time", dir, past_time},
+        {"file, before_epoch_time", file, before_epoch_time},
+        {"dir, before_epoch_time", dir, before_epoch_time},
+        {"file, just_before_epoch_time", file, just_before_epoch_time},
+        {"dir, just_before_epoch_time", dir, just_before_epoch_time}
     };
     for (const auto& TC : cases) {
+        std::cerr << "Test Case = " << TC.case_name << "\n";
         const auto old_times = GetTimes(TC.p);
         file_time_type old_time;
         TEST_REQUIRE(ConvertFromTimeSpec(old_time, old_times.write));
@@ -444,11 +446,19 @@ TEST_CASE(set_last_write_time_dynamic_en
         last_write_time(TC.p, TC.new_time, ec);
         TEST_CHECK(!ec);
 
-        file_time_type  got_time = last_write_time(TC.p);
+        ec = GetTestEC();
+        file_time_type  got_time = last_write_time(TC.p, ec);
+        TEST_REQUIRE(!ec);
 
         if (TimeIsRepresentableByFilesystem(TC.new_time)) {
             TEST_CHECK(got_time != old_time);
             TEST_CHECK(CompareTime(got_time, TC.new_time));
+
+            // FIXME(EricWF): Remove these after getting information from
+            // some failing bots.
+            std::cerr << (long long)got_time.time_since_epoch().count() << std::endl;
+            std::cerr << (long long)TC.new_time.time_since_epoch().count() << std::endl;
+
             TEST_CHECK(CompareTime(LastAccessTime(TC.p), old_times.access));
         }
     }




More information about the cfe-commits mailing list