summaryrefslogtreecommitdiffstats
path: root/src/test/common/test_util.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/common/test_util.cc')
-rw-r--r--src/test/common/test_util.cc8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/test/common/test_util.cc b/src/test/common/test_util.cc
index cf589bafc84..6249d387656 100644
--- a/src/test/common/test_util.cc
+++ b/src/test/common/test_util.cc
@@ -16,12 +16,18 @@
#include "include/util.h"
#include "gtest/gtest.h"
+#if __has_include(<filesystem>)
+#include <filesystem>
+namespace fs = std::filesystem;
+#else
#include <experimental/filesystem>
+namespace fs = std::experimental::filesystem;
+#endif
#if defined(__linux__)
TEST(util, collect_sys_info)
{
- if (!std::experimental::filesystem::exists("/etc/os-release")) {
+ if (!fs::exists("/etc/os-release")) {
GTEST_SKIP() << "skipping as '/etc/os-release' does not exist";
}