Skip to content

Commit ef854a3

Browse files
authored
[Tool] [Windows] Output build duration (#120311)
* [Tool][Windows] Output build duration * Tweak * Format
1 parent b4908f3 commit ef854a3

File tree

2 files changed

+32
-3
lines changed

2 files changed

+32
-3
lines changed

dev/devicelab/lib/tasks/run_tests.dart

Lines changed: 31 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,15 +58,15 @@ TaskFunction createMacOSRunReleaseTest() {
5858
}
5959

6060
TaskFunction createWindowsRunDebugTest() {
61-
return DesktopRunOutputTest(
61+
return WindowsRunOutputTest(
6262
'${flutterDirectory.path}/dev/integration_tests/ui',
6363
'lib/empty.dart',
6464
release: false,
6565
).call;
6666
}
6767

6868
TaskFunction createWindowsRunReleaseTest() {
69-
return DesktopRunOutputTest(
69+
return WindowsRunOutputTest(
7070
'${flutterDirectory.path}/dev/integration_tests/ui',
7171
'lib/empty.dart',
7272
release: true,
@@ -164,6 +164,30 @@ class AndroidRunOutputTest extends RunOutputTask {
164164
}
165165
}
166166

167+
class WindowsRunOutputTest extends DesktopRunOutputTest {
168+
WindowsRunOutputTest(
169+
super.testDirectory,
170+
super.testTarget, {
171+
required super.release,
172+
super.allowStderr = false,
173+
}
174+
);
175+
176+
static final RegExp _buildOutput = RegExp(
177+
r'Building Windows application\.\.\.\s*\d+(\.\d+)?(ms|s)',
178+
multiLine: true,
179+
);
180+
181+
@override
182+
void verifyBuildOutput(List<String> stdout) {
183+
_findNextMatcherInList(
184+
stdout,
185+
_buildOutput.hasMatch,
186+
'Building Windows application...',
187+
);
188+
}
189+
}
190+
167191
class DesktopRunOutputTest extends RunOutputTask {
168192
DesktopRunOutputTest(
169193
super.testDirectory,
@@ -188,6 +212,8 @@ class DesktopRunOutputTest extends RunOutputTask {
188212
'Launching $testTarget on',
189213
);
190214

215+
verifyBuildOutput(stdout);
216+
191217
_findNextMatcherInList(
192218
stdout,
193219
(String line) => line.contains('Quit (terminate the application on the device).'),
@@ -202,6 +228,9 @@ class DesktopRunOutputTest extends RunOutputTask {
202228

203229
return TaskResult.success(null);
204230
}
231+
232+
/// Verify the output from `flutter run`'s build step.
233+
void verifyBuildOutput(List<String> stdout) {}
205234
}
206235

207236
/// Test that the output of `flutter run` is expected.

packages/flutter_tools/lib/src/windows/build_windows.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ Future<void> buildWindows(WindowsProject windowsProject, BuildInfo buildInfo, {
9090
}
9191
await _runBuild(cmakePath, buildDirectory, buildModeName);
9292
} finally {
93-
status.cancel();
93+
status.stop();
9494
}
9595
if (buildInfo.codeSizeDirectory != null && sizeAnalyzer != null) {
9696
final String arch = getNameForTargetPlatform(TargetPlatform.windows_x64);

0 commit comments

Comments
 (0)