Skip to content

Commit

Permalink
Update source and test driver for running test262 on windows
Browse files Browse the repository at this point in the history
Signed-off-by: Seonghyun Kim <[email protected]>
  • Loading branch information
ksh8281 committed Jul 4, 2023
1 parent 6216708 commit 5a95ed1
Show file tree
Hide file tree
Showing 9 changed files with 240 additions and 192 deletions.
89 changes: 49 additions & 40 deletions .github/workflows/es-actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,45 +43,6 @@ jobs:
ninja -Cout/mac/x64
./tools/run-tests.py --engine="./out/mac/x64/escargot" new-es
build-on-windows:
runs-on: windows-2022
steps:
- uses: actions/checkout@v3
with:
submodules: true
- uses: lukka/get-cmake@latest
- uses: GuillaumeFalourd/[email protected]
with:
sdk-version: 20348
- uses: ilammy/[email protected]
with:
arch: x86
sdk: "10.0.20348.0"
- name: Install msvc redist package
run: |
(new-object System.Net.WebClient).DownloadFile('https://github.com/abbodi1406/vcredist/releases/download/v0.73.0/VisualCppRedist_AIO_x86_x64.exe','VisualCppRedist_AIO_x86_x64.exe')
.\VisualCppRedist_AIO_x86_x64.exe /y
- name: Copy octane
run: |
copy test\octane\*.js
dir
- name: Build Win32 Release
run: |
CMake -G "Visual Studio 16 2019" -DCMAKE_SYSTEM_NAME=Windows -DCMAKE_SYSTEM_VERSION:STRING="10.0" -DCMAKE_SYSTEM_PROCESSOR=x86 -DESCARGOT_ARCH=x86 -DESCARGOT_MODE=release -Bout/win32_release_ninja/ -DESCARGOT_HOST=windows -DESCARGOT_OUTPUT=shell -DESCARGOT_LIBICU_SUPPORT=ON -DESCARGOT_LIBICU_SUPPORT_WITH_DLOPEN=OFF -DESCARGOT_TEST=ON -G Ninja -DCMAKE_C_COMPILER=cl -DCMAKE_CXX_COMPILER=cl -DCMAKE_BUILD_TYPE=release
CMake --build out/win32_release_ninja/ --config Release
.\out\win32_release_ninja\escargot.exe run.js
- uses: ilammy/[email protected]
with:
arch: x64
sdk: "10.0.20348.0"
- name: Build Win64 Release
run: |
CMake -G "Visual Studio 16 2019" -DCMAKE_SYSTEM_NAME=Windows -DCMAKE_SYSTEM_VERSION:STRING="10.0" -DCMAKE_SYSTEM_PROCESSOR=x64 -DESCARGOT_ARCH=x64 -DESCARGOT_MODE=release -Bout/win64_release_ninja/ -DESCARGOT_HOST=windows -DESCARGOT_OUTPUT=shell -DESCARGOT_LIBICU_SUPPORT=ON -DESCARGOT_LIBICU_SUPPORT_WITH_DLOPEN=OFF -DESCARGOT_TEST=ON -G Ninja -DCMAKE_C_COMPILER=cl -DCMAKE_CXX_COMPILER=cl -DCMAKE_BUILD_TYPE=release
CMake --build out/win64_release_ninja/ --config Release
.\out\win64_release_ninja\escargot.exe run.js
- if: ${{ failure() }}
uses: mxschmitt/action-tmate@v3
timeout-minutes: 15
build-test-on-android:
runs-on: macos-12
strategy:
Expand Down Expand Up @@ -214,6 +175,54 @@ jobs:
ninja -Cout/release
python3 ./tools/run-tests.py --engine="./out/release/escargot" new-es
test-on-windows:
runs-on: windows-2022
strategy:
matrix:
arch: [x86, x64]
steps:
- uses: actions/checkout@v3
with:
submodules: true
- uses: szenius/[email protected]
with:
timezoneWindows: "Pacific Standard Time"
- uses: lukka/get-cmake@latest
- uses: GuillaumeFalourd/[email protected]
with:
sdk-version: 20348
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Install msvc redist package
run: |
(new-object System.Net.WebClient).DownloadFile('https://github.com/abbodi1406/vcredist/releases/download/v0.73.0/VisualCppRedist_AIO_x86_x64.exe','VisualCppRedist_AIO_x86_x64.exe')
.\VisualCppRedist_AIO_x86_x64.exe /y
- uses: ilammy/[email protected]
with:
arch: ${{ matrix.arch }}
sdk: "10.0.20348.0"
- name: Build ${{ matrix.arch }} Release
run: |
CMake -G "Visual Studio 16 2019" -DCMAKE_SYSTEM_NAME=Windows -DCMAKE_SYSTEM_VERSION:STRING="10.0" -DCMAKE_SYSTEM_PROCESSOR=${{ matrix.arch }} -DESCARGOT_ARCH=${{ matrix.arch }} -DESCARGOT_MODE=release -Bout/ -DESCARGOT_HOST=windows -DESCARGOT_OUTPUT=shell -DESCARGOT_LIBICU_SUPPORT=ON -DESCARGOT_LIBICU_SUPPORT_WITH_DLOPEN=OFF -DESCARGOT_THREADING=ON -DESCARGOT_TCO=ON -DESCARGOT_TEST=ON -G Ninja -DCMAKE_C_COMPILER=cl -DCMAKE_CXX_COMPILER=cl -DCMAKE_BUILD_TYPE=release
CMake --build out/ --config Release
# windows internal ICU doesn't support Temporal and intl402 well
# github action windows runner only have 2 CPUs. that's why I disable Atomics(timeout occured with some tests)
- name: Run test262
run: |
set GC_FREE_SPACE_DIVISOR=1
pip install chardet
python tools\run-tests.py --engine=%cd%\out\escargot.exe test262 --extra-arg="--skip Temporal --skip intl402 --skip Atomics"
shell: cmd
- name: Run octane
run: |
copy test\octane\*.js
dir
.\out\escargot.exe run.js
- if: ${{ failure() }}
uses: mxschmitt/action-tmate@v3
timeout-minutes: 15
build-test-on-x86-release:
runs-on: ubuntu-latest
strategy:
Expand Down Expand Up @@ -454,4 +463,4 @@ jobs:
- name: Run x86 test
run: $RUNNER --arch=x86 --engine="$GITHUB_WORKSPACE/out/wasm/x86/escargot" wasm-js
- name: Run x64 test
run: $RUNNER --arch=x86_64 --engine="$GITHUB_WORKSPACE/out/wasm/x64/escargot" wasm-js
run: $RUNNER --arch=x86_64 --engine="$GITHUB_WORKSPACE/out/wasm/x64/escargot" wasm-js
1 change: 1 addition & 0 deletions src/runtime/DateObject.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1317,6 +1317,7 @@ String* DateObject::toTimeString(ExecutionState& state)
snprintf(buffer, sizeof(buffer), "%02d:%02d:%02d GMT%s%04d", getHours(state), getMinutes(state), getSeconds(state), (tzOffsetAsMin < 0) ? "-" : "+", std::abs(tzOffsetHour + tzOffsetMin));
StringBuilder sb;
sb.appendString(buffer);
sb.appendChar(' ');
sb.appendChar('(');
sb.appendString(String::fromUTF8(timeZoneName.data(), timeZoneName.length()));
sb.appendChar(')');
Expand Down
3 changes: 2 additions & 1 deletion src/util/SpinLock.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,9 @@ class SpinLock {

public:
SpinLock()
: m_locked(ATOMIC_FLAG_INIT)
: m_locked()
{
m_locked.clear();
}

void lock()
Expand Down
2 changes: 1 addition & 1 deletion third_party/GCutil
Loading

0 comments on commit 5a95ed1

Please sign in to comment.