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
9 changes: 9 additions & 0 deletions .github/workflows/native-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,15 @@ jobs:
run: ctest --preset cxx20 -R '^cxx20-library-features$' -V
- name: Install smoke test
run: cmake --install build/${{ matrix.preset }} --prefix build/install
- name: Configure shared-library lifecycle test
if: matrix.preset == 'release'
run: cmake -S . -B build/shared-lifecycle -DBUILD_SHARED_LIBS=ON -DBUILD_BINARY=OFF -DBUILD_TESTING=ON -DCMAKE_BUILD_TYPE=Release
- name: Build shared-library lifecycle test
if: matrix.preset == 'release'
run: cmake --build build/shared-lifecycle --config Release --target uchardet-lifecycle --parallel 2
- name: Test shared-library lifecycle
if: matrix.preset == 'release'
run: ctest --test-dir build/shared-lifecycle -C Release -R '^native-lifecycle$' --output-on-failure --no-tests=error

diagnostics:
runs-on: ubuntu-24.04
Expand Down
1 change: 1 addition & 0 deletions src/symbols.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ set(
uchardet_handle_data
uchardet_data_end
uchardet_reset
uchardet_is_done
uchardet_get_charset
uchardet_get_n_candidates
uchardet_get_encoding
Expand Down
7 changes: 7 additions & 0 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,13 @@ set_target_properties(

add_executable(uchardet-lifecycle uchardet-lifecycle.cpp)
target_link_libraries(uchardet-lifecycle ${UCHARDET_LIBRARY})
if(WIN32 AND BUILD_SHARED_LIBS)
add_custom_command(TARGET uchardet-lifecycle POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different
$<TARGET_FILE:${UCHARDET_LIBRARY}>
$<TARGET_FILE_DIR:uchardet-lifecycle>
VERBATIM)
endif()
add_test(NAME native-lifecycle COMMAND uchardet-lifecycle)
set_tests_properties(native-lifecycle PROPERTIES TIMEOUT 10)

Expand Down
3 changes: 3 additions & 0 deletions test/LIFECYCLE.ja.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ ctest --test-dir /disk/lifecycle-build -R '^native-lifecycle$' --output-on-failu
```

CTest timeoutは10秒。標準engineや公開APIを変更しない。
CIではstatic presetに加え、Linux/macOS/WindowsのRelease shared libraryにも
同じtestをリンクして実行する。既存の公開関数`uchardet_is_done`がGNU/Darwinの
export一覧から漏れていた問題を修正し、shared構成のリンク回帰も検出する。
error/OOM注入、arbitrary-byte fuzz、大入力、並列利用、language weightの全契約は未対象。
nativeの繰返しfinalizeやfinalize後feedについては、Python wrapperが呼出しを抑止する
挙動とnative C APIの保証を混同せず、今回のtestで保証を追加しない。
Expand Down
Loading