mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
Test profile and release build and unit tests (flutter/engine#7880)
* Test profile build and unit tests * update googletest, skip JIT tests on non-debug builds
This commit is contained in:
parent
b9ceb3090d
commit
53102bd3a2
2
DEPS
2
DEPS
@ -131,7 +131,7 @@ deps = {
|
||||
Var('fuchsia_git') + '/third_party/benchmark' + '@' + '21f1eb3fe269ea43eba862bf6b699cde46587ade',
|
||||
|
||||
'src/third_party/googletest':
|
||||
Var('fuchsia_git') + '/third_party/googletest' + '@' + '2072b0053d3537fa5e8d222e34c759987aae1320',
|
||||
Var('fuchsia_git') + '/third_party/googletest' + '@' + '50a5a788420bd44501a75562de8936fd7ac32117',
|
||||
|
||||
'src/third_party/rapidjson':
|
||||
Var('fuchsia_git') + '/third_party/rapidjson' + '@' + '32d07c55db1bb6c2ae17cba4033491a667647753',
|
||||
|
||||
@ -24,7 +24,19 @@ task:
|
||||
cd $ENGINE_PATH/src
|
||||
./flutter/tools/gn --unoptimized
|
||||
ninja -C out/host_debug_unopt
|
||||
test_host_script: cd $ENGINE_PATH/src && ./flutter/testing/run_tests.sh
|
||||
test_host_script: cd $ENGINE_PATH/src && ./flutter/testing/run_tests.sh host_debug_unopt
|
||||
- name: build_and_test_host_profile
|
||||
compile_host_script: |
|
||||
cd $ENGINE_PATH/src
|
||||
./flutter/tools/gn --runtime-mode profile --no-lto
|
||||
ninja -C out/host_profile
|
||||
test_host_script: cd $ENGINE_PATH/src && ./flutter/testing/run_tests.sh host_profile
|
||||
- name: build_and_test_host_release
|
||||
compile_host_script: |
|
||||
cd $ENGINE_PATH/src
|
||||
./flutter/tools/gn --runtime-mode release --no-lto
|
||||
ninja -C out/host_release
|
||||
test_host_script: cd $ENGINE_PATH/src && ./flutter/testing/run_tests.sh host_release
|
||||
- name: build_android
|
||||
compile_host_script: |
|
||||
cd $ENGINE_PATH/src
|
||||
|
||||
@ -93,6 +93,7 @@ executable("runtime_unittests") {
|
||||
deps = [
|
||||
":runtime",
|
||||
":runtime_fixtures",
|
||||
"$flutter_root/common",
|
||||
"$flutter_root/fml",
|
||||
"$flutter_root/lib/snapshot",
|
||||
"$flutter_root/testing",
|
||||
|
||||
@ -11,6 +11,12 @@
|
||||
#include "flutter/testing/thread_test.h"
|
||||
#include "third_party/tonic/scopes/dart_isolate_scope.h"
|
||||
|
||||
#if FLUTTER_RUNTIME_MODE != FLUTTER_RUNTIME_MODE_DEBUG
|
||||
#define SKIP_IF_AOT() GTEST_SKIP()
|
||||
#else
|
||||
#define SKIP_IF_AOT() (void)0
|
||||
#endif
|
||||
|
||||
#define CURRENT_TEST_NAME \
|
||||
std::string { \
|
||||
::testing::UnitTest::GetInstance()->current_test_info()->name() \
|
||||
@ -213,18 +219,21 @@ std::unique_ptr<AutoIsolateShutdown> RunDartCodeInIsolate(
|
||||
}
|
||||
|
||||
TEST_F(DartIsolateTest, IsolateCanLoadAndRunDartCode) {
|
||||
SKIP_IF_AOT();
|
||||
auto isolate = RunDartCodeInIsolate(GetCurrentTaskRunner(), "main");
|
||||
ASSERT_TRUE(isolate);
|
||||
ASSERT_EQ(isolate->get()->GetPhase(), DartIsolate::Phase::Running);
|
||||
}
|
||||
|
||||
TEST_F(DartIsolateTest, IsolateCannotLoadAndRunUnknownDartEntrypoint) {
|
||||
SKIP_IF_AOT();
|
||||
auto isolate =
|
||||
RunDartCodeInIsolate(GetCurrentTaskRunner(), "thisShouldNotExist");
|
||||
ASSERT_FALSE(isolate);
|
||||
}
|
||||
|
||||
TEST_F(DartIsolateTest, CanRunDartCodeCodeSynchronously) {
|
||||
SKIP_IF_AOT();
|
||||
auto isolate = RunDartCodeInIsolate(GetCurrentTaskRunner(), "main");
|
||||
|
||||
ASSERT_TRUE(isolate);
|
||||
|
||||
@ -2,22 +2,28 @@
|
||||
|
||||
set -o pipefail -e;
|
||||
|
||||
HOST_DIR=${1:-host_debug_unopt}
|
||||
|
||||
# TODO(dnfield): Re-enable this when the upstream Dart changes that make it not be flaky land.
|
||||
# out/host_debug_unopt/embedder_unittests
|
||||
out/host_debug_unopt/flow_unittests
|
||||
out/host_debug_unopt/fml_unittests --gtest_filter="-*TimeSensitiveTest*"
|
||||
out/host_debug_unopt/runtime_unittests
|
||||
out/host_debug_unopt/shell_unittests
|
||||
out/host_debug_unopt/synchronization_unittests
|
||||
out/host_debug_unopt/txt_unittests --font-directory=flutter/third_party/txt/third_party/fonts
|
||||
# out/$HOST_DIR/embedder_unittests
|
||||
out/$HOST_DIR/flow_unittests
|
||||
out/$HOST_DIR/fml_unittests --gtest_filter="-*TimeSensitiveTest*"
|
||||
out/$HOST_DIR/runtime_unittests
|
||||
out/$HOST_DIR/shell_unittests
|
||||
out/$HOST_DIR/synchronization_unittests
|
||||
out/$HOST_DIR/txt_unittests --font-directory=flutter/third_party/txt/third_party/fonts
|
||||
|
||||
# pubspec.yaml points to these files
|
||||
./flutter/tools/gn --unoptimized
|
||||
ninja -C out/host_debug_unopt flutter/sky/packages
|
||||
|
||||
pushd flutter/testing/dart
|
||||
pub get
|
||||
popd
|
||||
|
||||
run_test () {
|
||||
out/host_debug_unopt/dart out/host_debug_unopt/gen/frontend_server.dart.snapshot --sdk-root out/host_debug_unopt/flutter_patched_sdk --incremental --strong --target=flutter --packages flutter/testing/dart/.packages --output-dill out/host_debug_unopt/engine_test.dill $1
|
||||
out/host_debug_unopt/flutter_tester --disable-observatory --use-test-fonts out/host_debug_unopt/engine_test.dill
|
||||
out/$HOST_DIR/dart out/$HOST_DIR/gen/frontend_server.dart.snapshot --sdk-root out/$HOST_DIR/flutter_patched_sdk --incremental --strong --target=flutter --packages flutter/testing/dart/.packages --output-dill out/$HOST_DIR/engine_test.dill $1
|
||||
out/$HOST_DIR/flutter_tester --disable-observatory --use-test-fonts out/$HOST_DIR/engine_test.dill
|
||||
}
|
||||
|
||||
# Verify that a failing test returns a failure code.
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user