未验证 提交 e9c99846 编写于 作者: Y Yegor 提交者: GitHub

add a convenience CLI tool for building and testing web engine (#12197)

上级 bfa43e17
...@@ -41,7 +41,7 @@ task: ...@@ -41,7 +41,7 @@ task:
$ENGINE_PATH/src/out/host_debug_unopt/dart-sdk/bin/pub get $ENGINE_PATH/src/out/host_debug_unopt/dart-sdk/bin/pub get
cd $ENGINE_PATH/src/flutter/lib/web_ui cd $ENGINE_PATH/src/flutter/lib/web_ui
$ENGINE_PATH/src/out/host_debug_unopt/dart-sdk/bin/pub get $ENGINE_PATH/src/out/host_debug_unopt/dart-sdk/bin/pub get
CHROME_NO_SANDBOX=true $ENGINE_PATH/src/out/host_debug_unopt/dart-sdk/bin/dart dev/test.dart CHROME_NO_SANDBOX=true $ENGINE_PATH/src/out/host_debug_unopt/dart-sdk/bin/dart dev/felt.dart
fetch_framework_script: | fetch_framework_script: |
mkdir -p $FRAMEWORK_PATH mkdir -p $FRAMEWORK_PATH
cd $FRAMEWORK_PATH cd $FRAMEWORK_PATH
......
#!/bin/bash
# felt: a command-line utility for building and testing Flutter web engine.
# It stands for Flutter Engine Local Tester.
FELT_PATH=`which felt`
if [ -z "$FELT_PATH" ]
then
echo "ERROR: felt is not in your PATH"
echo "Fix: add lib/web_ui/dev to your PATH"
exit 1
fi
GCLIENT_PATH=`which gclient`
if [ -z "$GCLIENT_PATH" ]
then
echo "ERROR: gclient is not in your PATH"
echo "Fix: add the path to your installation of depot_tools to your PATH"
exit 1
fi
NINJA_PATH=`which ninja`
if [ -z "$NINJA_PATH" ]
then
echo "ERROR: ninja is not in your PATH"
echo "Fix: add the path to your installation of depot_tools to your PATH"
exit 1
fi
ENGINE_SRC_DIR="$(dirname $(dirname $(dirname $(dirname $(dirname ${FELT_PATH})))))"
FLUTTER_DIR="${ENGINE_SRC_DIR}/flutter"
WEB_UI_DIR="${FLUTTER_DIR}/lib/web_ui"
DEV_DIR="${WEB_UI_DIR}/dev"
OUT_DIR="${ENGINE_SRC_DIR}/out"
HOST_DEBUG_UNOPT_DIR="${ENGINE_SRC_DIR}/out/host_debug_unopt"
DART_SDK_DIR="${ENGINE_SRC_DIR}/out/host_debug_unopt/dart-sdk"
GN="${FLUTTER_DIR}/tools/gn"
if [ ! -d "${OUT_DIR}" ] || [ ! -d "${HOST_DEBUG_UNOPT_DIR}" ]
then
echo "Compiling the Dart SDK."
gclient sync
$GN --unoptimized --full-dart-sdk
ninja -C $HOST_DEBUG_UNOPT_DIR
fi
(cd $WEB_UI_DIR && $DART_SDK_DIR/bin/dart dev/felt.dart $@)
...@@ -138,7 +138,10 @@ Future<void> _buildTests() async { ...@@ -138,7 +138,10 @@ Future<void> _buildTests() async {
} }
} }
Future<int> _runTestBatch( /// Runs a batch of tests.
///
/// Unless [expectFailure] is set to false, sets [io.exitCode] to a non-zero value if any tests fail.
Future<void> _runTestBatch(
List<String> testFiles, { List<String> testFiles, {
@required int concurrency, @required int concurrency,
@required bool expectFailure, @required bool expectFailure,
...@@ -174,6 +177,4 @@ Future<int> _runTestBatch( ...@@ -174,6 +177,4 @@ Future<int> _runTestBatch(
io.exitCode = 1; io.exitCode = 1;
} }
} }
return io.exitCode;
} }
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册