forked from Rexios80/packages_flutter
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[cross_file] Add run_tests.dart (and remove install_chromium_for_benc…
…hmarks.sh) (flutter#1756)
- Loading branch information
Showing
7 changed files
with
105 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# See https://github.com/dart-lang/test/blob/master/pkgs/test/doc/configuration.md#arguments | ||
override_platforms: | ||
chrome: | ||
settings: | ||
executable: chrome | ||
arguments: --no-sandbox |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,4 +12,5 @@ dependencies: | |
meta: ^1.3.0 | ||
|
||
dev_dependencies: | ||
path: ^1.8.1 | ||
test: ^1.21.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
// Copyright 2013 The Flutter Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
// Runs `dart test -p chrome` in the root of the cross_file package. | ||
// | ||
// Called from the custom-tests CI action. | ||
// | ||
// usage: dart run tool/run_tests.dart | ||
// (needs a `chrome` executable in $PATH, or a tweak to dart_test.yaml) | ||
import 'dart:io'; | ||
import 'package:path/path.dart' as p; | ||
|
||
Future<void> main(List<String> args) async { | ||
final Directory workingDir = | ||
Directory(p.dirname(Platform.script.path)).parent; | ||
|
||
final int status = await _runProcess( | ||
'dart', | ||
<String>[ | ||
'test', | ||
'-p', | ||
'chrome', | ||
], | ||
workingDirectory: workingDir.path, | ||
); | ||
|
||
exit(status); | ||
} | ||
|
||
Future<Process> _streamOutput(Future<Process> processFuture) async { | ||
final Process process = await processFuture; | ||
stdout.addStream(process.stdout); | ||
stderr.addStream(process.stderr); | ||
return process; | ||
} | ||
|
||
Future<int> _runProcess( | ||
String command, | ||
List<String> arguments, { | ||
String? workingDirectory, | ||
}) async { | ||
final Process process = await _streamOutput(Process.start( | ||
command, | ||
arguments, | ||
workingDirectory: workingDirectory, | ||
)); | ||
return process.exitCode; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.