Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions shell/platform/embedder/test_utils/proc_table_replacement.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,7 @@
// FlutterEngineProcTable entries (by using statics) to facilitate mocking in
// tests of code built on top of the embedder API.
//
// This should *ONLY* be used in unit tests as it is leaky by design. Because it
// uses statics for the lambdas, tests using this macro are generally not safe
// to run multiple times (e.g., using gtest_repeat).
// This should *ONLY* be used in unit tests as it is leaky by design.
//
// |proc| should be the name of an entry in FlutterEngineProcTable, such as
// "Initialize". |mock_impl| should be a lamba that replaces its implementation,
Expand All @@ -19,7 +17,8 @@
([&]() { \
static std::function< \
std::remove_pointer_t<decltype(FlutterEngineProcTable::proc)>> \
closure = mock_impl; \
closure; \
closure = mock_impl; \
static auto non_capturing = [](auto... args) { return closure(args...); }; \
return non_capturing; \
})()
15 changes: 6 additions & 9 deletions testing/run_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,12 +166,9 @@ def RunCCTests(build_dir, filter, coverage, capture_core_dump):
import resource
resource.setrlimit(resource.RLIMIT_CORE, (resource.RLIM_INFINITY, resource.RLIM_INFINITY))

# Not all of the engine unit tests are designed to be run more than once.
non_repeatable_shuffle_flags = [
"--gtest_shuffle",
]
shuffle_flags = non_repeatable_shuffle_flags + [
shuffle_flags = [
"--gtest_repeat=2",
"--gtest_shuffle",
]

RunEngineExecutable(build_dir, 'client_wrapper_glfw_unittests', filter, shuffle_flags, coverage=coverage)
Expand All @@ -187,7 +184,7 @@ def RunCCTests(build_dir, filter, coverage, capture_core_dump):
RunEngineExecutable(build_dir, 'embedder_unittests', filter, shuffle_flags, coverage=coverage)
RunEngineExecutable(build_dir, 'embedder_proctable_unittests', filter, shuffle_flags, coverage=coverage)
else:
RunEngineExecutable(build_dir, 'flutter_windows_unittests', filter, non_repeatable_shuffle_flags, coverage=coverage)
RunEngineExecutable(build_dir, 'flutter_windows_unittests', filter, shuffle_flags, coverage=coverage)

RunEngineExecutable(build_dir, 'client_wrapper_windows_unittests', filter, shuffle_flags, coverage=coverage)

Expand Down Expand Up @@ -225,16 +222,16 @@ def RunCCTests(build_dir, filter, coverage, capture_core_dump):
# These unit-tests are Objective-C and can only run on Darwin.
if IsMac():
RunEngineExecutable(build_dir, 'flutter_channels_unittests', filter, shuffle_flags, coverage=coverage)
RunEngineExecutable(build_dir, 'flutter_desktop_darwin_unittests', filter, non_repeatable_shuffle_flags, coverage=coverage)
RunEngineExecutable(build_dir, 'flutter_desktop_darwin_unittests', filter, shuffle_flags, coverage=coverage)

# https://github.com/flutter/flutter/issues/36296
if IsLinux():
icu_flags = ['--icu-data-file-path=%s' % os.path.join(build_dir, 'icudtl.dat')]
RunEngineExecutable(build_dir, 'txt_unittests', filter, icu_flags + shuffle_flags, coverage=coverage)

if IsLinux():
RunEngineExecutable(build_dir, 'flutter_linux_unittests', filter, non_repeatable_shuffle_flags, coverage=coverage)
RunEngineExecutable(build_dir, 'flutter_glfw_unittests', filter, non_repeatable_shuffle_flags, coverage=coverage)
RunEngineExecutable(build_dir, 'flutter_linux_unittests', filter, shuffle_flags, coverage=coverage)
RunEngineExecutable(build_dir, 'flutter_glfw_unittests', filter, shuffle_flags, coverage=coverage)


def RunEngineBenchmarks(build_dir, filter):
Expand Down