Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
bafa03e5
Unverified
Commit
bafa03e5
authored
Mar 06, 2020
by
Jonah Williams
Committed by
GitHub
Mar 06, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[flutter_tools] Remove mocking and simplify Dart target tests (#50688)
parent
8872d1d8
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
421 additions
and
380 deletions
+421
-380
compile.dart
packages/flutter_tools/lib/src/compile.dart
+5
-9
dart_test.dart
...ls/test/general.shard/build_system/targets/dart_test.dart
+405
-371
fake_process_manager.dart
packages/flutter_tools/test/src/fake_process_manager.dart
+11
-0
No files found.
packages/flutter_tools/lib/src/compile.dart
View file @
bafa03e5
...
...
@@ -241,7 +241,8 @@ class PackageUriMapper {
}
}
List
<
String
>
_buildModeOptions
(
BuildMode
mode
)
{
/// List the preconfigured build options for a given build mode.
List
<
String
>
buildModeOptions
(
BuildMode
mode
)
{
switch
(
mode
)
{
case
BuildMode
.
debug
:
return
<
String
>[
...
...
@@ -316,7 +317,7 @@ class KernelCompiler {
'-Ddart.developer.causal_async_stacks=
${buildMode == BuildMode.debug}
'
,
for
(
final
Object
dartDefine
in
dartDefines
)
'-D
$dartDefine
'
,
...
_
buildModeOptions
(
buildMode
),
...
buildModeOptions
(
buildMode
),
if
(
trackWidgetCreation
)
'--track-widget-creation'
,
if
(!
linkPlatformKernelIn
)
'--no-link-platform'
,
if
(
aot
)
...<
String
>[
...
...
@@ -357,14 +358,9 @@ class KernelCompiler {
];
globals
.
printTrace
(
command
.
join
(
' '
));
final
Process
server
=
await
globals
.
processManager
.
start
(
command
)
.
catchError
((
dynamic
error
,
StackTrace
stack
)
{
globals
.
printError
(
'Failed to start frontend server
$error
,
$stack
'
);
});
final
Process
server
=
await
globals
.
processManager
.
start
(
command
);
final
StdoutHandler
_stdoutHandler
=
StdoutHandler
();
server
.
stderr
.
transform
<
String
>(
utf8
.
decoder
)
.
listen
(
globals
.
printError
);
...
...
@@ -678,7 +674,7 @@ class DefaultResidentCompiler implements ResidentCompiler {
'--packages'
,
packagesPath
,
],
...
_
buildModeOptions
(
buildMode
),
...
buildModeOptions
(
buildMode
),
if
(
trackWidgetCreation
)
'--track-widget-creation'
,
if
(
fileSystemRoots
!=
null
)
for
(
final
String
root
in
fileSystemRoots
)
...<
String
>[
...
...
packages/flutter_tools/test/general.shard/build_system/targets/dart_test.dart
View file @
bafa03e5
This diff is collapsed.
Click to expand it.
packages/flutter_tools/test/src/fake_process_manager.dart
View file @
bafa03e5
...
...
@@ -202,6 +202,11 @@ abstract class FakeProcessManager implements ProcessManager {
/// This is a no-op on [FakeProcessManager.any].
void
addCommand
(
FakeCommand
command
);
/// Whether this fake has more [FakeCommand]s that are expected to run.
///
/// This is always `true` for [FakeProcessManager.any].
bool
get
hasRemainingExpectations
;
@protected
FakeCommand
findCommand
(
List
<
String
>
command
,
String
workingDirectory
,
Map
<
String
,
String
>
environment
);
...
...
@@ -299,6 +304,9 @@ class _FakeAnyProcessManager extends FakeProcessManager {
@override
void
addCommand
(
FakeCommand
command
)
{
}
@override
bool
get
hasRemainingExpectations
=>
true
;
}
class
_SequenceProcessManager
extends
FakeProcessManager
{
...
...
@@ -325,4 +333,7 @@ class _SequenceProcessManager extends FakeProcessManager {
void
addCommand
(
FakeCommand
command
)
{
_commands
.
add
(
command
);
}
@override
bool
get
hasRemainingExpectations
=>
_commands
.
isNotEmpty
;
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment