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
5dbeb8f0
Commit
5dbeb8f0
authored
Oct 23, 2015
by
Devon Carew
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix tests on windows
remove a runInShell arg on windows when launching pub
parent
6b2d6fdc
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
24 additions
and
11 deletions
+24
-11
init.dart
packages/flutter_tools/lib/src/commands/init.dart
+4
-2
device.dart
packages/flutter_tools/lib/src/device.dart
+2
-2
process.dart
packages/flutter_tools/lib/src/process.dart
+6
-0
pubspec.yaml
packages/flutter_tools/pubspec.yaml
+1
-1
init_test.dart
packages/flutter_tools/test/init_test.dart
+2
-1
list_test.dart
packages/flutter_tools/test/list_test.dart
+9
-5
No files found.
packages/flutter_tools/lib/src/commands/init.dart
View file @
5dbeb8f0
...
...
@@ -9,6 +9,8 @@ import 'package:args/command_runner.dart';
import
'package:mustache4dart/mustache4dart.dart'
as
mustache
;
import
'package:path/path.dart'
as
p
;
import
'../process.dart'
;
class
InitCommand
extends
Command
{
final
String
name
=
'init'
;
final
String
description
=
'Create a new Flutter project.'
;
...
...
@@ -43,8 +45,8 @@ class InitCommand extends Command {
if
(
argResults
[
'pub'
])
{
print
(
"Running pub get..."
);
Process
process
=
await
Process
.
start
(
'pub'
,
[
'get'
],
workingDirectory:
out
.
path
);
Process
process
=
await
Process
.
start
(
sdkBinaryName
(
'pub'
)
,
[
'get'
],
workingDirectory:
out
.
path
);
stdout
.
addStream
(
process
.
stdout
);
stderr
.
addStream
(
process
.
stderr
);
int
code
=
await
process
.
exitCode
;
...
...
packages/flutter_tools/lib/src/device.dart
View file @
5dbeb8f0
...
...
@@ -773,8 +773,8 @@ class AndroidDevice extends Device {
[
adbPath
,
'forward'
,
observatoryPortString
,
observatoryPortString
]);
// Actually start the server.
await
Process
.
start
(
'pub'
,
[
'run'
,
'sky_tools:sky_server'
,
_serverPort
],
workingDirectory:
serverRoot
,
mode:
ProcessStartMode
.
DETACHED
,
runInShell:
Platform
.
isWindows
);
await
Process
.
start
(
sdkBinaryName
(
'pub'
)
,
[
'run'
,
'sky_tools:sky_server'
,
_serverPort
],
workingDirectory:
serverRoot
,
mode:
ProcessStartMode
.
DETACHED
);
// Set up reverse port-forwarding so that the Android app can reach the
// server running on localhost.
...
...
packages/flutter_tools/lib/src/process.dart
View file @
5dbeb8f0
...
...
@@ -64,6 +64,12 @@ String runCheckedSync(List<String> cmd) =>
/// Run cmd and return stdout.
String
runSync
(
List
<
String
>
cmd
)
=>
_runWithLoggingSync
(
cmd
);
/// Return the platform specific name for the given Dart SDK binary. So, `pub`
/// ==> `pub.bat`.
String
sdkBinaryName
(
String
name
)
{
return
Platform
.
isWindows
?
'
${name}
.bat'
:
name
;
}
String
_runWithLoggingSync
(
List
<
String
>
cmd
,
{
bool
checked:
false
})
{
_logging
.
info
(
cmd
.
join
(
' '
));
ProcessResult
results
=
...
...
packages/flutter_tools/pubspec.yaml
View file @
5dbeb8f0
...
...
@@ -12,6 +12,7 @@ dependencies:
args
:
^0.13.0
asn1lib
:
^0.4.1
cipher
:
^0.7.1
crypto
:
^0.9.1
mustache4dart
:
^1.0.0
path
:
^1.3.0
shelf_route
:
^0.13.4
...
...
@@ -19,7 +20,6 @@ dependencies:
shelf
:
^0.6.2
test
:
"
>=0.12.4+5
<0.12.5"
yaml
:
^2.1.3
crypto
:
^0.9.1
dev_dependencies
:
mockito
:
"
^0.10.1"
...
...
packages/flutter_tools/test/init_test.dart
View file @
5dbeb8f0
...
...
@@ -11,6 +11,7 @@ import 'dart:io';
import
'package:args/command_runner.dart'
;
import
'package:path/path.dart'
as
p
;
import
'package:sky_tools/src/commands/init.dart'
;
import
'package:sky_tools/src/process.dart'
;
import
'package:test/test.dart'
;
main
()
=>
defineTests
();
...
...
@@ -38,7 +39,7 @@ defineTests() {
String
path
=
p
.
join
(
temp
.
path
,
'lib'
,
'main.dart'
);
expect
(
new
File
(
path
).
existsSync
(),
true
);
ProcessResult
exec
=
Process
.
runSync
(
'dartanalyzer'
,
[
'--fatal-warnings'
,
path
],
sdkBinaryName
(
'dartanalyzer'
)
,
[
'--fatal-warnings'
,
path
],
workingDirectory:
temp
.
path
);
if
(
exec
.
exitCode
!=
0
)
{
print
(
exec
.
stdout
);
...
...
packages/flutter_tools/test/list_test.dart
View file @
5dbeb8f0
...
...
@@ -2,6 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import
'dart:io'
;
import
'package:args/command_runner.dart'
;
import
'package:mockito/mockito.dart'
;
import
'package:sky_tools/src/commands/list.dart'
;
...
...
@@ -14,23 +16,25 @@ main() => defineTests();
defineTests
()
{
group
(
'list'
,
()
{
test
(
'returns 0 when called'
,
()
{
final
String
mockCommand
=
Platform
.
isWindows
?
'cmd /c echo'
:
'echo'
;
ListCommand
command
=
new
ListCommand
();
applyMocksToCommand
(
command
);
MockDeviceStore
mockDevices
=
command
.
devices
;
// Avoid relying on adb being installed on the test system.
// Instead, cause the test to run the echo command.
when
(
mockDevices
.
android
.
adbPath
).
thenReturn
(
'echo'
);
when
(
mockDevices
.
android
.
adbPath
).
thenReturn
(
mockCommand
);
// Avoid relying on idevice* being installed on the test system.
// Instead, cause the test to run the echo command.
when
(
mockDevices
.
iOS
.
informerPath
).
thenReturn
(
'echo'
);
when
(
mockDevices
.
iOS
.
installerPath
).
thenReturn
(
'echo'
);
when
(
mockDevices
.
iOS
.
listerPath
).
thenReturn
(
'echo'
);
when
(
mockDevices
.
iOS
.
informerPath
).
thenReturn
(
mockCommand
);
when
(
mockDevices
.
iOS
.
installerPath
).
thenReturn
(
mockCommand
);
when
(
mockDevices
.
iOS
.
listerPath
).
thenReturn
(
mockCommand
);
// Avoid relying on xcrun being installed on the test system.
// Instead, cause the test to run the echo command.
when
(
mockDevices
.
iOSSimulator
.
xcrunPath
).
thenReturn
(
'echo'
);
when
(
mockDevices
.
iOSSimulator
.
xcrunPath
).
thenReturn
(
mockCommand
);
CommandRunner
runner
=
new
CommandRunner
(
'test_flutter'
,
''
)
...
...
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