forked from flutter/engine
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add first Linux shell tests (flutter#18159)
- Loading branch information
1 parent
cf13c7f
commit 805a887
Showing
6 changed files
with
72 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
// 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/linux/public/flutter_linux/fl_dart_project.h" | ||
#include "gtest/gtest.h" | ||
|
||
#include <gmodule.h> | ||
|
||
TEST(FlDartProjectTest, GetPath) { | ||
g_autoptr(FlDartProject) project = | ||
fl_dart_project_new("/projects/my_dart_project"); | ||
EXPECT_STREQ(fl_dart_project_get_path(project), "/projects/my_dart_project"); | ||
} | ||
|
||
TEST(FlDartProjectTest, GetPathRelative) { | ||
g_autoptr(FlDartProject) project = fl_dart_project_new("foo"); | ||
g_autofree gchar* exe_path = g_file_read_link("/proc/self/exe", nullptr); | ||
ASSERT_TRUE(exe_path != nullptr); | ||
g_autofree gchar* dir = g_path_get_dirname(exe_path); | ||
g_autofree gchar* expected_path = g_build_filename(dir, "foo", nullptr); | ||
EXPECT_STREQ(fl_dart_project_get_path(project), expected_path); | ||
} | ||
|
||
TEST(FlDartProjectTest, GetAssetsPath) { | ||
g_autoptr(FlDartProject) project = | ||
fl_dart_project_new("/projects/my_dart_project"); | ||
g_autofree gchar* assets_path = fl_dart_project_get_assets_path(project); | ||
EXPECT_STREQ(assets_path, "/projects/my_dart_project/flutter_assets"); | ||
} | ||
|
||
TEST(FlDartProjectTest, GetIcuDataPath) { | ||
g_autoptr(FlDartProject) project = | ||
fl_dart_project_new("/projects/my_dart_project"); | ||
g_autofree gchar* assets_path = fl_dart_project_get_icu_data_path(project); | ||
EXPECT_STREQ(assets_path, "/projects/my_dart_project/icudtl.dat"); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters