Enable repeat for desktop embedder tests (flutter/engine#28253)

This commit is contained in:
Matej Knopp
2021-08-23 18:07:02 +02:00
committed by GitHub
parent 41f40a15ac
commit b48f5143ac
2 changed files with 9 additions and 13 deletions

View File

@@ -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,
@@ -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; \
})()

View File

@@ -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)
@@ -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)
@@ -225,7 +222,7 @@ 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():
@@ -233,8 +230,8 @@ def RunCCTests(build_dir, filter, coverage, capture_core_dump):
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):