[libcxx-commits] [libcxx] b4a289b - [libcxx] [test] Split the file_time_type synopsis test
Martin Storsjö via libcxx-commits
libcxx-commits at lists.llvm.org
Wed Oct 21 00:00:32 PDT 2020
Author: Martin Storsjö
Date: 2020-10-21T10:00:02+03:00
New Revision: b4a289b03ced24799da818f7da4cb0febe35ac4b
URL: https://github.com/llvm/llvm-project/commit/b4a289b03ced24799da818f7da4cb0febe35ac4b
DIFF: https://github.com/llvm/llvm-project/commit/b4a289b03ced24799da818f7da4cb0febe35ac4b.diff
LOG: [libcxx] [test] Split the file_time_type synopsis test
Split the resolution check to a separate test, which is marked as
unsupported on windows.
On windows (both with MS STL and libstdc++), the file time has
100 ns resolution; the standard doesn't mandate a specific resolution.
Differential Revision: https://reviews.llvm.org/D89535
Added:
libcxx/test/std/input.output/filesystems/fs.filesystem.synopsis/file_time_type_resolution.compile.pass.cpp
Modified:
libcxx/test/std/input.output/filesystems/fs.filesystem.synopsis/file_time_type.pass.cpp
Removed:
################################################################################
diff --git a/libcxx/test/std/input.output/filesystems/fs.filesystem.synopsis/file_time_type.pass.cpp b/libcxx/test/std/input.output/filesystems/fs.filesystem.synopsis/file_time_type.pass.cpp
index 09b8aed5a5c8..afdf0ec15b94 100644
--- a/libcxx/test/std/input.output/filesystems/fs.filesystem.synopsis/file_time_type.pass.cpp
+++ b/libcxx/test/std/input.output/filesystems/fs.filesystem.synopsis/file_time_type.pass.cpp
@@ -32,16 +32,8 @@ void test_trivial_clock() {
((void)odr_use);
}
-void test_time_point_resolution_and_range() {
- using namespace fs;
- using Dur = file_time_type::duration;
- using Period = Dur::period;
- ASSERT_SAME_TYPE(Period, std::nano);
-}
-
int main(int, char**) {
test_trivial_clock();
- test_time_point_resolution_and_range();
return 0;
}
diff --git a/libcxx/test/std/input.output/filesystems/fs.filesystem.synopsis/file_time_type_resolution.compile.pass.cpp b/libcxx/test/std/input.output/filesystems/fs.filesystem.synopsis/file_time_type_resolution.compile.pass.cpp
new file mode 100644
index 000000000000..965e7a4620b8
--- /dev/null
+++ b/libcxx/test/std/input.output/filesystems/fs.filesystem.synopsis/file_time_type_resolution.compile.pass.cpp
@@ -0,0 +1,27 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++03, windows
+
+// MS STL and libstdc++ use the native windows file timestamp resolution,
+// with 100 ns resolution.
+
+// <filesystem>
+
+// typedef TrivialClock file_time_type;
+
+#include "filesystem_include.h"
+#include <chrono>
+#include <type_traits>
+
+#include "test_macros.h"
+
+using namespace fs;
+using Dur = file_time_type::duration;
+using Period = Dur::period;
+ASSERT_SAME_TYPE(Period, std::nano);
More information about the libcxx-commits
mailing list