mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
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++
25 lines
766 B
C++
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
|