flutter_flutter/shell/platform/common/cpp/path_utils_unittests.cc
stuartmorgan 710f738dd6
Allow relative resource paths in GLFW embedding (#16944)
Currently every Linux runner has this code to allow relative resource paths; this moves it into the framework so that any embedder can get this behavior without that code needing to be in the template.

Rolls buildroot to pick up std::filesystem support in our libc++
2020-03-17 19:04:18 -07:00

25 lines
766 B
C++

// Copyright 2013 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "flutter/shell/platform/common/cpp/path_utils.h"
#include "gtest/gtest.h"
namespace flutter {
// Tests that GetExecutableDirectory returns a valid, absolute path.
TEST(PathUtilsTest, ExecutableDirector) {
std::filesystem::path exe_directory = GetExecutableDirectory();
#if defined(__linux__) || defined(_WIN32)
EXPECT_EQ(exe_directory.empty(), false);
EXPECT_EQ(exe_directory.is_absolute(), true);
#else
// On platforms where it's not implemented, it should indicate that
// by returning an empty path.
EXPECT_EQ(exe_directory.empty(), true);
#endif
}
} // namespace flutter