diff --git a/HISTORY.md b/HISTORY.md index 05c7adad0a..8706ab6d89 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -1,5 +1,10 @@ # Keyman Version History +## 17.0.177 alpha 2023-09-20 + +* chore(linux): Add coverage action to `ibus-keyman/build.sh` (#9583) +* docs(common): Fix documentation for `builder_describe_internal_dependency` (#9582) + ## 17.0.176 alpha 2023-09-19 * chore(oem/fv/android): Update Gradle to 7.4 (#9590) diff --git a/VERSION.md b/VERSION.md index 67199519cf..981cad9c9f 100644 --- a/VERSION.md +++ b/VERSION.md @@ -1 +1 @@ -17.0.177 \ No newline at end of file +17.0.178 \ No newline at end of file diff --git a/docs/settings/linux/tasks.json b/docs/settings/linux/tasks.json index 9751c95a44..891c8b5d15 100644 --- a/docs/settings/linux/tasks.json +++ b/docs/settings/linux/tasks.json @@ -166,6 +166,23 @@ "group": "build", "detail": "run unit and integration tests of ibus-keyman" }, + { + "type": "shell", + "label": "ibus-keyman: report", + "command": "./build.sh", + "args": [ + "test", + "--report", + "--debug", + "--coverage", + "--no-integration" + ], + "options": { + "cwd": "${workspaceFolder}/linux/ibus-keyman/", + }, + "group": "build", + "detail": "run tests and create unit test coverage report" + }, { "type": "shell", "label": "keyman-config: tests", diff --git a/linux/ibus-keyman/build.sh b/linux/ibus-keyman/build.sh index 58bc057691..bc136546d6 100755 --- a/linux/ibus-keyman/build.sh +++ b/linux/ibus-keyman/build.sh @@ -20,7 +20,9 @@ builder_describe \ "install install artifacts" \ "uninstall uninstall artifacts" \ "@/core:arch" \ - "--no-integration don't run integration tests" + "--no-integration don't run integration tests" \ + "--report create coverage report" \ + "--coverage capture test coverage" builder_parse "$@" @@ -40,6 +42,12 @@ builder_describe_outputs \ configure "${MESON_PATH}/build.ninja" \ build "${MESON_PATH}/src/ibus-engine-keyman" +if builder_has_option --coverage; then + MESON_COVERAGE=-Db_coverage=true +else + MESON_COVERAGE= +fi + if builder_start_action clean; then rm -rf "$THIS_SCRIPT_PATH/../build/" builder_finish_action success clean @@ -48,7 +56,7 @@ fi if builder_start_action configure; then cd "$THIS_SCRIPT_PATH" # shellcheck disable=SC2086 - meson setup "$MESON_PATH" --werror --buildtype $MESON_TARGET "${builder_extra_params[@]}" + meson setup "$MESON_PATH" --werror --buildtype $MESON_TARGET ${MESON_COVERAGE} "${builder_extra_params[@]}" builder_finish_action success configure fi @@ -65,6 +73,10 @@ if builder_start_action test; then else meson test --print-errorlogs $builder_verbose fi + if builder_has_option --coverage; then + # Note: requires lcov > 1.16 to properly work (see https://github.com/mesonbuild/meson/issues/6747) + ninja coverage-html + fi builder_finish_action success test fi diff --git a/resources/build/build-utils.md b/resources/build/build-utils.md index 6c27e5e8a4..5ba91cffc6 100644 --- a/resources/build/build-utils.md +++ b/resources/build/build-utils.md @@ -510,8 +510,8 @@ builder_describe_internal_dependency action:target depaction:deptarget ... ```bash builder_describe_internal_dependency \ - mac:build mac-x86_64:build \ - mac:build mac-arm64:build + build:mac build:mac-x86_64 \ + build:mac build:mac-arm64 ``` **Note:** actions and targets must be fully specified, and this _must_ be called diff --git a/resources/builder.inc.sh b/resources/builder.inc.sh index d4d6bf7e2a..0eb4b995b6 100755 --- a/resources/builder.inc.sh +++ b/resources/builder.inc.sh @@ -1143,8 +1143,8 @@ _builder_define_default_internal_dep() { # 2: depaction:deptarget The dependency action and target # Example: # builder_describe_internal_dependency \ -# mac:build mac-x86_64:build \ -# mac:build mac-arm64:build +# build:mac build:mac-x86_64 \ +# build:mac build:mac-arm64 # # Note: actions and targets must be fully specified, and this _must_ # be called before either builder_describe_outputs or builder_parse in