Skip to content

[migration/ilib-js-to-dart] test: rework test runner and add integration test support - #97

Merged
gouniLee merged 7 commits into
migration/ilib-js-to-dartfrom
feature/update-test-script
Aug 6, 2026
Merged

[migration/ilib-js-to-dart] test: rework test runner and add integration test support#97
gouniLee merged 7 commits into
migration/ilib-js-to-dartfrom
feature/update-test-script

Conversation

@gouniLee

@gouniLee gouniLee commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Checklist

The following lists affects Pub Points on pub.dev when the package is published.

  • Passed the all tests.
  • Verified that the example app works.
  • Executed the dart format command.
  • Added the API description is added if necessary.

Summary

Rework the test runner script to support both unit and integration test modes, add an API-level integration test, and update the CI workflow accordingly. This change is based on work originally done on the develop branch, brought over and updated to align with the current migration branch.

Changes

Script rename & rewrite: execute_unit_test.shexecute_test.sh

  • Renamed to reflect that the script now covers both unit and integration tests
  • Add unit | integration | all mode selection (default: all)
  • Add --help / -h option with usage documentation
  • Per-suite pass/fail reporting
  • xvfb-run support for headless widget test execution when DISPLAY is unset
  • Updated all references in CI, docs, and benchmark files

New: test/integration/example_app_api_test.dart

  • API-level integration test ported from the flutter_js (v1.x) interop to the pure-Dart ILibLoader
  • Verifies iLib version (class="token-number">2.0.class="token-number">0) and CLDR version (class="token-number">48.2)
  • Validates ILibDateFmt full datetime formatting for en-US locale

CI: .github/workflows/tests.yml

  • Switch runner from ubuntu-class="token-number">22.04 to ubuntu-latest
  • Install Linux desktop dependencies (clang, cmake, libgtk-class="token-number">3-dev, liblzma-dev, ninja-build, pkg-config, xvfb)

Test Structure

test/ (excluding test/integration/) → Unit tests (datefmt, numfmt, durfmt, etc.)
test/integration/ → API-level integration tests
example/integration_test/ → Widget-based integration tests (requires Linux device)

How to Test

./execute_test.sh              # Run all tests (default)
./execute_test.sh unit         # Unit tests only
./execute_test.sh integration  # Integration tests only
./execute_test.sh --help       # Show usage

Add unit|integration|all mode selection to execute_unit_test.sh with
separate pass/fail reporting per suite, and run example/ widget
integration tests under xvfb when no display is available.

Convert example_app_api_test.dart from flutter_js interop (ILibJS) to
the pure-Dart ILibLoader, updating the expected version to 2.0.0
- Support unit/integration/all mode selection (default: all)
- Add --help/-h option for usage information
- Include test/integration/ (API-level) and example/integration_test/
  (widget-based, requires Linux device) in integration mode
- Add xvfb-run support for headless widget test execution
- Add test/integration/example_app_api_test.dart ported to v2.0 API
- Sync CI workflow with develop (install Linux desktop dependencies)
The script now covers both unit and integration tests, so the "unit"
qualifier no longer applies. Update all references in CI workflow, docs,
and benchmark files.
@gouniLee
gouniLee requested a review from seonmiJin August 6, 2026 00:47
@gouniLee gouniLee self-assigned this Aug 6, 2026
@seonmiJin

Copy link
Copy Markdown
Contributor

The following 34 test files are missing the standard debugPrint('Testing [<filename>] file.'); log line at the start of main().

  • test/internal/plural_test.dart
  • test/date/datefmt_datetime_calendar_extra_test.dart
  • test/root/locale_extra_test.dart
  • test/calendar/ (31 files)

…ion.dart

Add missing debugPrint('Testing [filename] file.') to 35 test files
and replace the heavier flutter/material.dart import with
flutter/foundation.dart across all test files.
@gouniLee

gouniLee commented Aug 6, 2026

Copy link
Copy Markdown
Contributor Author

The following 34 test files are missing the standard debugPrint('Testing [<filename>] file.'); log line at the start of main().

  • test/internal/plural_test.dart
  • test/date/datefmt_datetime_calendar_extra_test.dart
  • test/root/locale_extra_test.dart
  • test/calendar/ (31 files)

I updated the test files where debugPrint is missing, and replace the overall imports of material.dart with foundation.dart. This version imports only the required utilities instead of the entire Material widget library.

@gouniLee
gouniLee merged commit b755ed0 into migration/ilib-js-to-dart Aug 6, 2026
1 check passed
@gouniLee
gouniLee deleted the feature/update-test-script branch August 6, 2026 08:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants