linux test

This commit is contained in:
ekibun
2021-01-22 15:18:11 +08:00
parent 9bbb68441f
commit 89d0750365
4 changed files with 29 additions and 1 deletions

23
.github/workflows/test.yml vendored Normal file
View File

@@ -0,0 +1,23 @@
name: Test
on:
push:
branches:
- master
jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [macos-latest, ubuntu-latest, windows-latest]
steps:
- uses: actions/checkout@v2
- name: Flutter action
uses: subosito/flutter-action@v1.1.1
with:
channel: "stable"
flutter-version: "1.12.x"
- run: flutter pub get
- run: flutter test test/flutter_qjs_test.dart

View File

@@ -81,6 +81,7 @@ add_custom_command(
${FLUTTER_TOOL_ENVIRONMENT}
"${FLUTTER_ROOT}/packages/flutter_tools/bin/tool_backend.sh"
linux-x64 ${CMAKE_BUILD_TYPE}
VERBATIM
)
add_custom_target(flutter_assemble DEPENDS
"${FLUTTER_LIBRARY}"

View File

@@ -54,7 +54,7 @@ final DynamicLibrary qjsLib = Platform.environment['FLUTTER_TEST'] == 'true'
? DynamicLibrary.open("test/build/Debug/ffiquickjs.dll")
: Platform.isMacOS
? DynamicLibrary.open("test/build/libffiquickjs.dylib")
: DynamicLibrary.process())
: DynamicLibrary.open("test/build/libffiquickjs.so"))
: (Platform.isWindows
? DynamicLibrary.open("flutter_qjs_plugin.dll")
: Platform.isAndroid

View File

@@ -3,6 +3,10 @@ project(ffiquickjs LANGUAGES CXX)
include("${CMAKE_CURRENT_SOURCE_DIR}/../cxx/quickjs.cmake")
IF (CMAKE_SYSTEM_NAME MATCHES "Linux")
target_compile_options(quickjs PRIVATE "-fPIC")
ENDIF ()
add_library(ffiquickjs SHARED ${CXX_LIB_DIR}/ffi.cpp)
target_compile_features(ffiquickjs PUBLIC cxx_std_17)
target_link_libraries(ffiquickjs PRIVATE quickjs)