@@ -66,15 +66,25 @@ void main() {
66
66
tryToDelete (fileSystem.directory (tempDirectory));
67
67
}
68
68
}, skip: Platform .isWindows); // [intended] Windows doesn't support sending signals so we don't care if it can store the PID.
69
- testWithoutContext ('flutter run handle SIGUSR1/2' , () async {
69
+
70
+ testWithoutContext ('flutter run handle SIGUSR1/2 run' , () async {
70
71
final String tempDirectory = fileSystem.systemTempDirectory.createTempSync ('flutter_overall_experience_test.' ).resolveSymbolicLinksSync ();
71
72
final String pidFile = fileSystem.path.join (tempDirectory, 'flutter.pid' );
72
73
final String testDirectory = fileSystem.path.join (flutterRoot, 'dev' , 'integration_tests' , 'ui' );
73
74
final String testScript = fileSystem.path.join ('lib' , 'commands.dart' );
74
75
late int pid;
76
+ final List <String > command = < String > [
77
+ 'run' ,
78
+ '-dflutter-tester' ,
79
+ '--report-ready' ,
80
+ '--pid-file' ,
81
+ pidFile,
82
+ '--no-devtools' ,
83
+ testScript,
84
+ ];
75
85
try {
76
86
final ProcessTestResult result = await runFlutter (
77
- < String > [ 'run' , '-dflutter-tester' , '--report-ready' , '--pid-file' , pidFile, '--no-devtools' , testScript] ,
87
+ command ,
78
88
testDirectory,
79
89
< Transition > [
80
90
Multiple (< Pattern > ['Flutter run key commands.' , 'called paint' ], handler: (String line) {
@@ -108,16 +118,22 @@ void main() {
108
118
'called main' ,
109
119
'called paint' ,
110
120
]);
111
- expect (result.stdout.where ((String line) => ! line.startsWith ('called ' )), < Object > [
112
- // logs start after we receive the response to sending SIGUSR1
113
- 'Performing hot reload...' .padRight (progressMessageWidth),
114
- startsWith ('Reloaded 0 libraries in ' ),
115
- 'Performing hot restart...' .padRight (progressMessageWidth),
116
- startsWith ('Restarted application in ' ),
117
- '' , // this newline is the one for after we hit "q"
118
- 'Application finished.' ,
119
- 'ready' ,
120
- ]);
121
+ expect (
122
+ result.stdout.where ((String line) => ! line.startsWith ('called ' )),
123
+ < Object > [
124
+ // logs start after we receive the response to sending SIGUSR1
125
+ 'Performing hot reload...' .padRight (progressMessageWidth),
126
+ startsWith ('Reloaded 0 libraries in ' ),
127
+ 'Performing hot restart...' .padRight (progressMessageWidth),
128
+ startsWith ('Restarted application in ' ),
129
+ '' , // this newline is the one for after we hit "q"
130
+ 'Application finished.' ,
131
+ 'ready' ,
132
+ ],
133
+ reason: 'stdout from command ${command .join (' ' )} was unexpected, '
134
+ 'full Stdout:\n\n ${result .stdout .join ('\n ' )}\n\n '
135
+ 'Stderr:\n\n ${result .stderr .join ('\n ' )}' ,
136
+ );
121
137
expect (result.exitCode, 0 );
122
138
} finally {
123
139
tryToDelete (fileSystem.directory (tempDirectory));
@@ -128,9 +144,16 @@ void main() {
128
144
final String tempDirectory = fileSystem.systemTempDirectory.createTempSync ('flutter_overall_experience_test.' ).resolveSymbolicLinksSync ();
129
145
final String testDirectory = fileSystem.path.join (flutterRoot, 'dev' , 'integration_tests' , 'ui' );
130
146
final String testScript = fileSystem.path.join ('lib' , 'commands.dart' );
147
+ final List <String > command = < String > [
148
+ 'run' ,
149
+ '-dflutter-tester' ,
150
+ '--report-ready' ,
151
+ '--no-devtools' ,
152
+ testScript,
153
+ ];
131
154
try {
132
155
final ProcessTestResult result = await runFlutter (
133
- < String > [ 'run' , '-dflutter-tester' , '--report-ready' , '--no-devtools' , testScript] ,
156
+ command ,
134
157
testDirectory,
135
158
< Transition > [
136
159
Multiple (< Pattern > ['Flutter run key commands.' , 'called main' , 'called paint' ], handler: (String line) {
@@ -171,23 +194,28 @@ void main() {
171
194
// debugPaintSizeEnabled = false:
172
195
'called paint' ,
173
196
]);
174
- expect (result.stdout.where ((String line) => ! line.startsWith ('called ' )), < Object > [
175
- // logs start after we receive the response to hitting "r"
176
- 'Performing hot reload...' .padRight (progressMessageWidth),
177
- startsWith ('Reloaded 0 libraries in ' ),
178
- 'ready' ,
179
- '' , // this newline is the one for after we hit "R"
180
- 'Performing hot restart...' .padRight (progressMessageWidth),
181
- startsWith ('Restarted application in ' ),
182
- 'ready' ,
183
- '' , // newline for after we hit "p" the first time
184
- 'ready' ,
185
- '' , // newline for after we hit "p" the second time
186
- 'ready' ,
187
- '' , // this newline is the one for after we hit "q"
188
- 'Application finished.' ,
189
- 'ready' ,
190
- ]);
197
+ expect (
198
+ result.stdout.where ((String line) => ! line.startsWith ('called ' )), < Object > [
199
+ // logs start after we receive the response to hitting "r"
200
+ 'Performing hot reload...' .padRight (progressMessageWidth),
201
+ startsWith ('Reloaded 0 libraries in ' ),
202
+ 'ready' ,
203
+ '' , // this newline is the one for after we hit "R"
204
+ 'Performing hot restart...' .padRight (progressMessageWidth),
205
+ startsWith ('Restarted application in ' ),
206
+ 'ready' ,
207
+ '' , // newline for after we hit "p" the first time
208
+ 'ready' ,
209
+ '' , // newline for after we hit "p" the second time
210
+ 'ready' ,
211
+ '' , // this newline is the one for after we hit "q"
212
+ 'Application finished.' ,
213
+ 'ready' ,
214
+ ],
215
+ reason: 'stdout from command ${command .join (' ' )} was unexpected, '
216
+ 'full Stdout:\n\n ${result .stdout .join ('\n ' )}\n\n '
217
+ 'Stderr:\n\n ${result .stderr .join ('\n ' )}' ,
218
+ );
191
219
expect (result.exitCode, 0 );
192
220
} finally {
193
221
tryToDelete (fileSystem.directory (tempDirectory));
0 commit comments