Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit 39f7066

Browse files
authored
Test profile and release build and unit tests (#7880)
* Test profile build and unit tests * update googletest, skip JIT tests on non-debug builds
1 parent abe9826 commit 39f7066

File tree

5 files changed

+39
-11
lines changed

5 files changed

+39
-11
lines changed

.cirrus.yml

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,19 @@ task:
2424
cd $ENGINE_PATH/src
2525
./flutter/tools/gn --unoptimized
2626
ninja -C out/host_debug_unopt
27-
test_host_script: cd $ENGINE_PATH/src && ./flutter/testing/run_tests.sh
27+
test_host_script: cd $ENGINE_PATH/src && ./flutter/testing/run_tests.sh host_debug_unopt
28+
- name: build_and_test_host_profile
29+
compile_host_script: |
30+
cd $ENGINE_PATH/src
31+
./flutter/tools/gn --runtime-mode profile --no-lto
32+
ninja -C out/host_profile
33+
test_host_script: cd $ENGINE_PATH/src && ./flutter/testing/run_tests.sh host_profile
34+
- name: build_and_test_host_release
35+
compile_host_script: |
36+
cd $ENGINE_PATH/src
37+
./flutter/tools/gn --runtime-mode release --no-lto
38+
ninja -C out/host_release
39+
test_host_script: cd $ENGINE_PATH/src && ./flutter/testing/run_tests.sh host_release
2840
- name: build_android
2941
compile_host_script: |
3042
cd $ENGINE_PATH/src

DEPS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ deps = {
131131
Var('fuchsia_git') + '/third_party/benchmark' + '@' + '21f1eb3fe269ea43eba862bf6b699cde46587ade',
132132

133133
'src/third_party/googletest':
134-
Var('fuchsia_git') + '/third_party/googletest' + '@' + '2072b0053d3537fa5e8d222e34c759987aae1320',
134+
Var('fuchsia_git') + '/third_party/googletest' + '@' + '50a5a788420bd44501a75562de8936fd7ac32117',
135135

136136
'src/third_party/rapidjson':
137137
Var('fuchsia_git') + '/third_party/rapidjson' + '@' + '32d07c55db1bb6c2ae17cba4033491a667647753',

runtime/BUILD.gn

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ executable("runtime_unittests") {
9393
deps = [
9494
":runtime",
9595
":runtime_fixtures",
96+
"$flutter_root/common",
9697
"$flutter_root/fml",
9798
"$flutter_root/lib/snapshot",
9899
"$flutter_root/testing",

runtime/dart_isolate_unittests.cc

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,12 @@
1111
#include "flutter/testing/thread_test.h"
1212
#include "third_party/tonic/scopes/dart_isolate_scope.h"
1313

14+
#if FLUTTER_RUNTIME_MODE != FLUTTER_RUNTIME_MODE_DEBUG
15+
#define SKIP_IF_AOT() GTEST_SKIP()
16+
#else
17+
#define SKIP_IF_AOT() (void)0
18+
#endif
19+
1420
#define CURRENT_TEST_NAME \
1521
std::string { \
1622
::testing::UnitTest::GetInstance()->current_test_info()->name() \
@@ -213,18 +219,21 @@ std::unique_ptr<AutoIsolateShutdown> RunDartCodeInIsolate(
213219
}
214220

215221
TEST_F(DartIsolateTest, IsolateCanLoadAndRunDartCode) {
222+
SKIP_IF_AOT();
216223
auto isolate = RunDartCodeInIsolate(GetCurrentTaskRunner(), "main");
217224
ASSERT_TRUE(isolate);
218225
ASSERT_EQ(isolate->get()->GetPhase(), DartIsolate::Phase::Running);
219226
}
220227

221228
TEST_F(DartIsolateTest, IsolateCannotLoadAndRunUnknownDartEntrypoint) {
229+
SKIP_IF_AOT();
222230
auto isolate =
223231
RunDartCodeInIsolate(GetCurrentTaskRunner(), "thisShouldNotExist");
224232
ASSERT_FALSE(isolate);
225233
}
226234

227235
TEST_F(DartIsolateTest, CanRunDartCodeCodeSynchronously) {
236+
SKIP_IF_AOT();
228237
auto isolate = RunDartCodeInIsolate(GetCurrentTaskRunner(), "main");
229238

230239
ASSERT_TRUE(isolate);

testing/run_tests.sh

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,28 @@
22

33
set -o pipefail -e;
44

5+
HOST_DIR=${1:-host_debug_unopt}
6+
57
# TODO(dnfield): Re-enable this when the upstream Dart changes that make it not be flaky land.
6-
# out/host_debug_unopt/embedder_unittests
7-
out/host_debug_unopt/flow_unittests
8-
out/host_debug_unopt/fml_unittests --gtest_filter="-*TimeSensitiveTest*"
9-
out/host_debug_unopt/runtime_unittests
10-
out/host_debug_unopt/shell_unittests
11-
out/host_debug_unopt/synchronization_unittests
12-
out/host_debug_unopt/txt_unittests --font-directory=flutter/third_party/txt/third_party/fonts
8+
# out/$HOST_DIR/embedder_unittests
9+
out/$HOST_DIR/flow_unittests
10+
out/$HOST_DIR/fml_unittests --gtest_filter="-*TimeSensitiveTest*"
11+
out/$HOST_DIR/runtime_unittests
12+
out/$HOST_DIR/shell_unittests
13+
out/$HOST_DIR/synchronization_unittests
14+
out/$HOST_DIR/txt_unittests --font-directory=flutter/third_party/txt/third_party/fonts
15+
16+
# pubspec.yaml points to these files
17+
./flutter/tools/gn --unoptimized
18+
ninja -C out/host_debug_unopt flutter/sky/packages
1319

1420
pushd flutter/testing/dart
1521
pub get
1622
popd
1723

1824
run_test () {
19-
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
20-
out/host_debug_unopt/flutter_tester --disable-observatory --use-test-fonts out/host_debug_unopt/engine_test.dill
25+
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
26+
out/$HOST_DIR/flutter_tester --disable-observatory --use-test-fonts out/$HOST_DIR/engine_test.dill
2127
}
2228

2329
# Verify that a failing test returns a failure code.

0 commit comments

Comments
 (0)