@@ -66,15 +66,25 @@ void main() {
6666 tryToDelete (fileSystem.directory (tempDirectory));
6767 }
6868 }, 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 {
7071 final String tempDirectory = fileSystem.systemTempDirectory.createTempSync ('flutter_overall_experience_test.' ).resolveSymbolicLinksSync ();
7172 final String pidFile = fileSystem.path.join (tempDirectory, 'flutter.pid' );
7273 final String testDirectory = fileSystem.path.join (flutterRoot, 'dev' , 'integration_tests' , 'ui' );
7374 final String testScript = fileSystem.path.join ('lib' , 'commands.dart' );
7475 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+ ];
7585 try {
7686 final ProcessTestResult result = await runFlutter (
77- < String > [ 'run' , '-dflutter-tester' , '--report-ready' , '--pid-file' , pidFile, '--no-devtools' , testScript] ,
87+ command ,
7888 testDirectory,
7989 < Transition > [
8090 Multiple (< Pattern > ['Flutter run key commands.' , 'called paint' ], handler: (String line) {
@@ -108,16 +118,22 @@ void main() {
108118 'called main' ,
109119 'called paint' ,
110120 ]);
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+ );
121137 expect (result.exitCode, 0 );
122138 } finally {
123139 tryToDelete (fileSystem.directory (tempDirectory));
@@ -128,9 +144,16 @@ void main() {
128144 final String tempDirectory = fileSystem.systemTempDirectory.createTempSync ('flutter_overall_experience_test.' ).resolveSymbolicLinksSync ();
129145 final String testDirectory = fileSystem.path.join (flutterRoot, 'dev' , 'integration_tests' , 'ui' );
130146 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+ ];
131154 try {
132155 final ProcessTestResult result = await runFlutter (
133- < String > [ 'run' , '-dflutter-tester' , '--report-ready' , '--no-devtools' , testScript] ,
156+ command ,
134157 testDirectory,
135158 < Transition > [
136159 Multiple (< Pattern > ['Flutter run key commands.' , 'called main' , 'called paint' ], handler: (String line) {
@@ -171,23 +194,28 @@ void main() {
171194 // debugPaintSizeEnabled = false:
172195 'called paint' ,
173196 ]);
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+ );
191219 expect (result.exitCode, 0 );
192220 } finally {
193221 tryToDelete (fileSystem.directory (tempDirectory));
0 commit comments