forked from microsoft/vscode
-
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.
esm - port over unit test changes (microsoft#225711)
- Loading branch information
Showing
13 changed files
with
2,501 additions
and
75 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
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,31 @@ | ||
@echo off | ||
setlocal | ||
|
||
set ELECTRON_RUN_AS_NODE= | ||
|
||
pushd %~dp0\.. | ||
|
||
:: Get Code.exe location | ||
for /f "tokens=2 delims=:," %%a in ('findstr /R /C:"\"nameShort\":.*" product.json') do set NAMESHORT=%%~a | ||
set NAMESHORT=%NAMESHORT: "=% | ||
set NAMESHORT=%NAMESHORT:"=%.exe | ||
set CODE=".build\electron\%NAMESHORT%" | ||
|
||
:: Download Electron if needed | ||
call node build\lib\electron.js | ||
if %errorlevel% neq 0 node .\node_modules\gulp\bin\gulp.js electron | ||
|
||
:: Run tests | ||
set ELECTRON_ENABLE_LOGGING=1 | ||
%CODE% .\test\unit\electron\index.esm.js --crash-reporter-directory=%~dp0\..\.build\crashes %* | ||
|
||
popd | ||
|
||
endlocal | ||
|
||
:: app.exit(0) is exiting with code 255 in Electron 1.7.4. | ||
:: See https://github.com/microsoft/vscode/issues/28582 | ||
echo errorlevel: %errorlevel% | ||
if %errorlevel% == 255 set errorlevel=0 | ||
|
||
exit /b %errorlevel% |
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,43 @@ | ||
#!/usr/bin/env bash | ||
set -e | ||
|
||
if [[ "$OSTYPE" == "darwin"* ]]; then | ||
realpath() { [[ $1 = /* ]] && echo "$1" || echo "$PWD/${1#./}"; } | ||
ROOT=$(dirname $(dirname $(realpath "$0"))) | ||
else | ||
ROOT=$(dirname $(dirname $(readlink -f $0))) | ||
# --disable-dev-shm-usage: when run on docker containers where size of /dev/shm | ||
# partition < 64MB which causes OOM failure for chromium compositor that uses the partition for shared memory | ||
LINUX_EXTRA_ARGS="--disable-dev-shm-usage" | ||
fi | ||
|
||
cd $ROOT | ||
|
||
if [[ "$OSTYPE" == "darwin"* ]]; then | ||
NAME=`node -p "require('./product.json').nameLong"` | ||
CODE="./.build/electron/$NAME.app/Contents/MacOS/Electron" | ||
else | ||
NAME=`node -p "require('./product.json').applicationName"` | ||
CODE=".build/electron/$NAME" | ||
fi | ||
|
||
VSCODECRASHDIR=$ROOT/.build/crashes | ||
|
||
# Node modules | ||
test -d node_modules || yarn | ||
|
||
# Get electron | ||
yarn electron | ||
|
||
# Unit Tests | ||
if [[ "$OSTYPE" == "darwin"* ]]; then | ||
cd $ROOT ; ulimit -n 4096 ; \ | ||
ELECTRON_ENABLE_LOGGING=1 \ | ||
"$CODE" \ | ||
test/unit/electron/index.esm.js --crash-reporter-directory=$VSCODECRASHDIR "$@" | ||
else | ||
cd $ROOT ; \ | ||
ELECTRON_ENABLE_LOGGING=1 \ | ||
"$CODE" \ | ||
test/unit/electron/index.esm.js --crash-reporter-directory=$VSCODECRASHDIR $LINUX_EXTRA_ARGS "$@" | ||
fi |
Oops, something went wrong.