Skip to content

Commit 0788c6f

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

File tree

6 files changed

+52
-8
lines changed

6 files changed

+52
-8
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"]
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 --stacktrace --debug

CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -314,6 +314,9 @@ endif()
314314
if (HERMES_IS_MOBILE_BUILD)
315315
add_definitions(-DHERMES_IS_MOBILE_BUILD)
316316
endif()
317+
if (HERMES_PARSE_FLOW)
318+
add_definitions(-DHERMES_PARSE_FLOW=1)
319+
endif()
317320

318321
if (HERMESVM_INTERNAL_JAVASCRIPT_NATIVE)
319322
add_definitions(-DHERMESVM_INTERNAL_JAVASCRIPT_NATIVE)

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_a"
3132
}
3233
}
3334
ndk {

android/intltest/build.gradle

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,13 @@ buildDir.mkdirs()
2020

2121
def testDestination = "java/com/facebook/hermes/test/assets"
2222

23+
// Don't redirect logs.
24+
tasks.withType(Test) {
25+
testLogging {
26+
showStandardStreams = true
27+
}
28+
}
29+
2330
task prepareTests() {
2431
doLast {
2532
def test262Dir = file(rootProject.ext.fbsource).exists() ?
@@ -68,13 +75,14 @@ android {
6875
externalNativeBuild {
6976
cmake {
7077
arguments "-DHERMES_IS_ANDROID=True"
78+
arguments "-DHERMES_PARSE_FLOW=1"
7179
arguments "-DHERMES_FACEBOOK_BUILD=${rootProject.ext.facebookBuild}"
7280
arguments "-DANDROID_STL=c++_shared"
7381
arguments "-DANDROID_PIE=True"
74-
arguments "-DIMPORT_HERMESC=${rootProject.ext.hermesC}"
82+
arguments "-DIMPORT_HOST_COMPILERS=${rootProject.ext.hermesC}"
7583
arguments "-DHERMES_SLOW_DEBUG=False"
7684
arguments "-DHERMES_ENABLE_INTL=True"
77-
targets "jsijni", "jsijniepi", "libhermes"
85+
targets "jsijni", "jsijniepi", "hermesvm_a"
7886
}
7987
}
8088
ndk {

android/intltest/java/com/facebook/hermes/test/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ if(HERMES_IS_ANDROID)
2424
add_hermes_library(jsijni SHARED
2525
${jni_source_files}
2626
LINK_OBJLIBS
27-
hermesvm
27+
hermesvm_a
2828
hermesapi
2929
compileJS
3030
fbjni::fbjni
@@ -35,7 +35,7 @@ if(HERMES_IS_ANDROID)
3535
add_hermes_library(jsijniepi SHARED
3636
${epi_source_files}
3737
LINK_OBJLIBS
38-
hermesvm
38+
hermesvm_a
3939
hermesapi
4040
compileJS
4141
fbjni::fbjni

0 commit comments

Comments
 (0)