Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions bridge/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -364,6 +364,20 @@ if (APPLE OR WIN32 OR CMAKE_SYSTEM_NAME STREQUAL "Linux")
include(./test/test.cmake)
endif ()

# Android integration tests also need the test bridge exports, but they do not
# build the desktop-only unit test targets from test.cmake.
if (IS_ANDROID AND ENABLE_TEST)
add_compile_definitions(IS_TEST=true)
target_sources(webf PRIVATE
include/webf_bridge_test.h
webf_bridge_test.cc
./test/test_framework_polyfill.c
test/webf_test_context.cc
test/webf_test_context.h
)
target_include_directories(webf PRIVATE ./test)
endif ()

#if(CMAKE_SYSTEM_NAME MATCHES "MSYS" OR MINGW)
# install(TARGETS webf
# LIBRARY DESTINATION lib # For Unix-like OSes
Expand Down
2 changes: 2 additions & 0 deletions scripts/tasks.js
Original file line number Diff line number Diff line change
Expand Up @@ -1105,6 +1105,7 @@ task('build-android-webf-lib', (done) => {
};
const buildType = (buildMode === 'Release' || buildMode == 'RelWithDebInfo') ? 'RelWithDebInfo' : 'Debug';
let externCmakeArgs = [];
const enableTest = buildMode !== 'Release';

if (process.env.ENABLE_ASAN === 'true') {
externCmakeArgs.push('-DENABLE_ASAN=true');
Expand Down Expand Up @@ -1162,6 +1163,7 @@ task('build-android-webf-lib', (done) => {
-DANDROID_SUPPORT_FLEXIBLE_PAGE_SIZES=ON \
-DIS_ANDROID=TRUE \
-DANDROID_ABI="${arch}" \
${enableTest ? '-DENABLE_TEST=true \\' : '\\'}
${isProfile ? '-DENABLE_PROFILE=TRUE \\' : '\\'}
${externCmakeArgs.join(' ')} \
-DANDROID_PLATFORM="android-18" \
Expand Down
7 changes: 7 additions & 0 deletions webf/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ allprojects {

apply plugin: 'com.android.library'

def enableTestBridge =
System.getenv('WEBF_ENABLE_TEST') == 'true' ||
System.getenv('KRAKEN_ENABLE_TEST') == 'true'


android {
if (project.android.hasProperty("namespace")) {
Expand All @@ -41,6 +45,9 @@ android {
externalNativeBuild {
cmake {
arguments "-DANDROID_STL=c++_shared", "-DIS_ANDROID=TRUE", "-DANDROID_SUPPORT_FLEXIBLE_PAGE_SIZES=ON"
if (enableTestBridge) {
arguments "-DENABLE_TEST=true"
}
}
}
}
Expand Down
2 changes: 0 additions & 2 deletions webf/android/src/main/java/com/openwebf/webf/WebFPlugin.java
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,6 @@ private static void loadLibrary() {
}
// Loads `libwebf.so`.
System.loadLibrary("webf");
// Loads `libquickjs.so`.
System.loadLibrary("quickjs");
isLibraryLoaded = true;
}

Expand Down
Loading