Skip to content

Commit 300d73d

Browse files
committed
Android tests now pass. StdoutLogger was holding on to destroyed mutex handles during instrumentation, causing crashes, and now route console output through the new NodeLiteRuntime::Callbacks. On Android we forward stdout/stderr to logcat via callbacks to work around this for now. Added Android-specific shims (node_lite_android.cpp, child_process_android.cpp) so native module loading uses dlopen and JS child_process.spawnSync safely reports “unsupported”. Extended the Node‑API harness to allow in-process execution: RunNodeLiteScript captures output, SetNodeApiTestEnvironment lets the JNI layer provide a base directory and asset manager, and the GTest registration path uses that configuration instead of shelling out to the node_lite executable
1 parent c365db2 commit 300d73d

15 files changed

Lines changed: 944 additions & 414 deletions

File tree

Tests/NodeApi/CMakeLists.txt

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,10 @@ function(node_api_copy_test_sources TARGET_NAME)
2020
)
2121
endfunction()
2222

23-
if(APPLE)
23+
if(ANDROID)
24+
set(NODE_LITE_PLATFORM_SRC node_lite_android.cpp)
25+
set(NODE_LITE_CHILD_PROCESS_SRC child_process_android.cpp)
26+
elseif(APPLE)
2427
set(NODE_LITE_PLATFORM_SRC node_lite_mac.cpp)
2528
set(NODE_LITE_CHILD_PROCESS_SRC child_process_mac.cpp)
2629
elseif(WIN32)
@@ -68,13 +71,14 @@ target_link_libraries(node_lite
6871
node_api_copy_test_sources(node_lite)
6972

7073
add_executable(NodeApiTests
71-
${NODE_LITE_CHILD_PROCESS_SRC}
72-
child_process.h
73-
string_utils.cpp
74-
string_utils.h
75-
test_basics.cpp
76-
test_main.cpp
77-
test_main.h
74+
${NODE_LITE_CHILD_PROCESS_SRC}
75+
child_process.h
76+
string_utils.cpp
77+
string_utils.h
78+
test_basics.cpp
79+
test_main.cpp
80+
main.cpp
81+
test_main.h
7882
)
7983

8084
target_include_directories(NodeApiTests

0 commit comments

Comments
 (0)