add a convenience CLI tool for building and testing web engine (flutter/engine#12197)
This commit is contained in:
@@ -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
|
||||||
|
|||||||
47
engine/src/flutter/lib/web_ui/dev/felt
Executable file
47
engine/src/flutter/lib/web_ui/dev/felt
Executable file
@@ -0,0 +1,47 @@
|
|||||||
|
#!/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 {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
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(
|
|||||||
io.exitCode = 1;
|
io.exitCode = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return io.exitCode;
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user