Skip to content

Commit a66e158

Browse files
lavenzgfacebook-github-bot
authored andcommitted
Add e2e android intl test (facebook#1644)
Summary: Pull Request resolved: facebook#1644 Differential Revision: D70862275
1 parent cde35df commit a66e158

File tree

4 files changed

+40
-6
lines changed

4 files changed

+40
-6
lines changed

.github/workflows/build.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,3 +121,35 @@ jobs:
121121
# toLocaleLowerCase and toLocaleUpperCase are the two main ones.
122122
# cmake --build ./build --target check-hermes
123123
python3 hermes/utils/test_runner.py --test-intl test262/test -b build/bin ${{ matrix.test_runner_flags }}
124+
125+
test-android-e2e-intl:
126+
strategy:
127+
fail-fast: false
128+
matrix:
129+
os: [ubuntu-24.04]
130+
abis: ["x86", "x86_64", "arm64-v8a", "armeabi-v7a"]
131+
runs-on: ${{ matrix.os }}
132+
env:
133+
HERMES_WS_DIR: /home/runner/work/hermes
134+
ANDROID_NDK: /usr/local/lib/android/sdk/ndk/27.1.12297006
135+
steps:
136+
- name: Checkout Hermes
137+
uses: actions/[email protected]
138+
- name: Checkout Test262
139+
run: |-
140+
cd "$HERMES_WS_DIR"
141+
git clone https://github.com/tc39/test262
142+
cd test262
143+
git checkout 62626e083bd506124aac6c799464d76c2c42851b
144+
- name: Build Hermes Compiler
145+
run: |-
146+
cd "$HERMES_WS_DIR"
147+
cmake -S hermes -B ./build -DCMAKE_BUILD_TYPE=Release
148+
cmake --build ./build -j 4 --target hermesc
149+
- name: Run android tests
150+
uses: ReactiveCircus/android-emulator-runner@v2
151+
with:
152+
api-level: 29
153+
cmake: 3.22.1
154+
emulator-options: -timezone Europe/Paris -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
155+
script: cd android && ./gradlew :intltest:prepareTests && ./gradlew -Pabis=${{ matrix.abis }} :intltest:connectedAndroidTest

android/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ buildscript {
2828
// This is used as part of the Hermes build process
2929
hermesC = ""
3030
for (f in [
31-
"${hermesHostBuild}/build/ImportHermesc.cmake",
32-
"${hermesHostBuild}/build_release/ImportHermesc.cmake"]) {
31+
"${hermesHostBuild}/build/ImportHostCompilers.cmake",
32+
"${hermesHostBuild}/build_release/ImportHostCompilers.cmake"]) {
3333
if(file(f).exists()) hermesC = f;
3434
}
3535
assert hermesC != "" : "Hermes host build not found"

android/hermes/build.gradle

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,14 @@ android {
2121
cmake {
2222
arguments "-DANDROID_SUPPORT_FLEXIBLE_PAGE_SIZES=ON"
2323
arguments "-DHERMES_IS_ANDROID=True"
24+
arguments "-DHERMES_PARSE_FLOW=1"
2425
arguments "-DHERMES_FACEBOOK_BUILD=${rootProject.ext.facebookBuild}"
2526
arguments "-DANDROID_STL=c++_shared"
2627
arguments "-DANDROID_PIE=True"
27-
arguments "-DIMPORT_HERMESC=${rootProject.ext.hermesC}"
28+
arguments "-DIMPORT_HOST_COMPILERS=${rootProject.ext.hermesC}"
2829
arguments "-DCMAKE_INTERPROCEDURAL_OPTIMIZATION=True"
2930
arguments "-DHERMES_BUILD_SHARED_JSI=True"
30-
targets "libhermes"
31+
targets "hermesvm"
3132
}
3233
}
3334
ndk {

android/intltest/build.gradle

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,13 +68,14 @@ android {
6868
externalNativeBuild {
6969
cmake {
7070
arguments "-DHERMES_IS_ANDROID=True"
71+
arguments "-DHERMES_PARSE_FLOW=1"
7172
arguments "-DHERMES_FACEBOOK_BUILD=${rootProject.ext.facebookBuild}"
7273
arguments "-DANDROID_STL=c++_shared"
7374
arguments "-DANDROID_PIE=True"
74-
arguments "-DIMPORT_HERMESC=${rootProject.ext.hermesC}"
75+
arguments "-DIMPORT_HOST_COMPILERS=${rootProject.ext.hermesC}"
7576
arguments "-DHERMES_SLOW_DEBUG=False"
7677
arguments "-DHERMES_ENABLE_INTL=True"
77-
targets "jsijni", "jsijniepi", "libhermes"
78+
targets "jsijni", "jsijniepi", "hermesvm"
7879
}
7980
}
8081
ndk {

0 commit comments

Comments
 (0)