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
a50b465c
Unverified
Commit
a50b465c
authored
Jan 19, 2018
by
Alexander Aprelev
Committed by
GitHub
Jan 19, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add --preview-dart-2 to 'flutter test' (#14135)
parent
bed71b9a
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
39 additions
and
8 deletions
+39
-8
test.dart
packages/flutter_tools/lib/src/commands/test.dart
+4
-0
compile.dart
packages/flutter_tools/lib/src/compile.dart
+7
-6
flutter_platform.dart
packages/flutter_tools/lib/src/test/flutter_platform.dart
+26
-2
runner.dart
packages/flutter_tools/lib/src/test/runner.dart
+2
-0
No files found.
packages/flutter_tools/lib/src/commands/test.dart
View file @
a50b465c
...
...
@@ -68,6 +68,9 @@ class TestCommand extends FlutterCommand {
negatable:
false
,
help:
'Handle machine structured JSON command input
\n
'
'and provide output and progress in machine friendly format.'
);
argParser
.
addFlag
(
'preview-dart-2'
,
hide:
!
verboseHelp
,
help:
'Preview Dart 2.0 functionality.'
);
}
@override
...
...
@@ -206,6 +209,7 @@ class TestCommand extends FlutterCommand {
startPaused:
startPaused
,
ipv6:
argResults
[
'ipv6'
],
machine:
machine
,
previewDart2:
argResults
[
'preview-dart-2'
],
);
if
(
collector
!=
null
)
{
...
...
packages/flutter_tools/lib/src/compile.dart
View file @
a50b465c
...
...
@@ -62,7 +62,8 @@ Future<String> compile(
bool
aot
:
false
,
bool
strongMode
:
false
,
List
<
String
>
extraFrontEndOptions
,
String
incrementalCompilerByteStorePath
})
async
{
String
incrementalCompilerByteStorePath
,
String
packagesPath
})
async
{
final
String
frontendServer
=
artifacts
.
getArtifactPath
(
Artifact
.
frontendServerSnapshotForEngineDartSdk
);
...
...
@@ -85,12 +86,12 @@ Future<String> compile(
command
.
add
(
'--strong'
);
}
if
(
incrementalCompilerByteStorePath
!=
null
)
{
command
.
addAll
(<
String
>[
'--incremental'
,
'--byte-store'
,
incrementalCompilerByteStorePath
]);
fs
.
directory
(
incrementalCompilerByteStorePath
).
createSync
(
recursive:
true
);
command
.
add
(
'--incremental'
);
}
if
(
packagesPath
!=
null
)
{
command
.
addAll
(<
String
>[
'--packages'
,
packagesPath
]);
}
if
(
extraFrontEndOptions
!=
null
)
command
.
addAll
(
extraFrontEndOptions
);
command
.
add
(
mainPath
);
...
...
packages/flutter_tools/lib/src/test/flutter_platform.dart
View file @
a50b465c
...
...
@@ -5,6 +5,8 @@
import
'dart:async'
;
import
'dart:convert'
;
import
'package:flutter_tools/src/artifacts.dart'
;
import
'package:flutter_tools/src/compile.dart'
;
import
'package:meta/meta.dart'
;
import
'package:stream_channel/stream_channel.dart'
;
...
...
@@ -56,6 +58,7 @@ void installHook({
bool
enableObservatory:
false
,
bool
machine:
false
,
bool
startPaused:
false
,
bool
previewDart2:
false
,
int
observatoryPort
,
InternetAddressType
serverType:
InternetAddressType
.
IP_V4
,
})
{
...
...
@@ -71,6 +74,7 @@ void installHook({
startPaused:
startPaused
,
explicitObservatoryPort:
observatoryPort
,
host:
_kHosts
[
serverType
],
previewDart2:
previewDart2
,
),
);
}
...
...
@@ -88,6 +92,7 @@ class _FlutterPlatform extends PlatformPlugin {
this
.
startPaused
,
this
.
explicitObservatoryPort
,
this
.
host
,
this
.
previewDart2
,
})
:
assert
(
shellPath
!=
null
);
final
String
shellPath
;
...
...
@@ -97,6 +102,7 @@ class _FlutterPlatform extends PlatformPlugin {
final
bool
startPaused
;
final
int
explicitObservatoryPort
;
final
InternetAddress
host
;
final
bool
previewDart2
;
// Each time loadChannel() is called, we spin up a local WebSocket server,
// then spin up the engine in a subprocess. We pass the engine a Dart file
...
...
@@ -191,14 +197,28 @@ class _FlutterPlatform extends PlatformPlugin {
));
// Start the engine subprocess.
printTrace
(
'test
$ourTestCount
: starting shell process'
);
printTrace
(
'test
$ourTestCount
: starting shell process
${previewDart2? " in preview-dart-2 mode":""}
'
);
final
String
mainDart
=
previewDart2
?
await
compile
(
sdkRoot:
artifacts
.
getArtifactPath
(
Artifact
.
flutterPatchedSdkPath
),
incrementalCompilerByteStorePath:
''
/* not null is enough */
,
mainPath:
listenerFile
.
path
,
packagesPath:
PackageMap
.
globalPackagesPath
)
:
listenerFile
.
path
;
// bundlePath needs to point to a folder with `platform.dill` file.
final
String
bundlePath
=
previewDart2
?
artifacts
.
getArtifactPath
(
Artifact
.
flutterPatchedSdkPath
)
:
null
;
final
Process
process
=
await
_startProcess
(
shellPath
,
listenerFile
.
path
,
mainDart
,
packages:
PackageMap
.
globalPackagesPath
,
enableObservatory:
enableObservatory
,
startPaused:
startPaused
,
observatoryPort:
explicitObservatoryPort
,
bundlePath:
bundlePath
,
);
subprocessActive
=
true
;
finalizers
.
add
(()
async
{
...
...
@@ -466,6 +486,7 @@ void main() {
String
executable
,
String
testPath
,
{
String
packages
,
String
bundlePath
,
bool
enableObservatory:
false
,
bool
startPaused:
false
,
int
observatoryPort
,
...
...
@@ -492,6 +513,9 @@ void main() {
}
if
(
host
.
type
==
InternetAddressType
.
IP_V6
)
command
.
add
(
'--ipv6'
);
if
(
bundlePath
!=
null
)
{
command
.
add
(
'--flutter-assets-dir=
$bundlePath
'
);
}
command
.
addAll
(<
String
>[
'--enable-dart-profiling'
,
'--non-interactive'
,
...
...
packages/flutter_tools/lib/src/test/runner.dart
View file @
a50b465c
...
...
@@ -28,6 +28,7 @@ Future<int> runTests(
bool
startPaused:
false
,
bool
ipv6:
false
,
bool
machine:
false
,
bool
previewDart2:
false
,
TestWatcher
watcher
,
})
async
{
// Compute the command-line arguments for package:test.
...
...
@@ -75,6 +76,7 @@ Future<int> runTests(
machine:
machine
,
startPaused:
startPaused
,
serverType:
serverType
,
previewDart2:
previewDart2
,
);
// Make the global packages path absolute.
...
...
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