From 4a3556ca89b4f3e279264d2785714191a8d81080 Mon Sep 17 00:00:00 2001 From: Eberhard Beilharz Date: Wed, 18 Oct 2023 16:06:28 +0200 Subject: [PATCH 1/2] chore(linux): Allow to collect coverage on TC --- docs/linux/README.md | 3 +++ linux/keyman-config/run-tests.sh | 9 ++++++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/docs/linux/README.md b/docs/linux/README.md index 8ee91fbe81e..fe29b0d623a 100644 --- a/docs/linux/README.md +++ b/docs/linux/README.md @@ -102,6 +102,9 @@ sudo apt install -y lcov libdatetime-perl gcovr pip3 install coverage ``` +**Note:** You want lcov > 1.16, so you might have to download and install +a newer version e.g. from . + #### Creating and displaying code coverage reports All three projects (ibus-keyman, keyman-config, and keyman-system-service) diff --git a/linux/keyman-config/run-tests.sh b/linux/keyman-config/run-tests.sh index de81ec7f738..de99c55e8f2 100755 --- a/linux/keyman-config/run-tests.sh +++ b/linux/keyman-config/run-tests.sh @@ -16,10 +16,13 @@ if [ -n "$TEAMCITY_VERSION" ]; then if ! pip3 list --format=columns | grep -q teamcity-messages; then pip3 install teamcity-messages fi - python3 -m teamcity.unittestpy discover -s tests -p test_*.py + test_module=teamcity.unittestpy else - # shellcheck disable=SC2086 - python3 ${coverage:-} -m unittest discover -v -s tests -p test_*.py + test_module=unittest + extra_opts=-v fi +# shellcheck disable=SC2086 +python3 ${coverage:-} -m ${test_module:-} discover ${extra_opts:-} -s tests -p test_*.py + rm -rf "$XDG_CONFIG_HOME" From 09907b66e0a80fabcceb4a7c4f67b5866ac31ad8 Mon Sep 17 00:00:00 2001 From: Eberhard Beilharz Date: Wed, 18 Oct 2023 18:07:54 +0200 Subject: [PATCH 2/2] chore(linux): Additionally specify regular schemas path --- linux/keyman-config/build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/linux/keyman-config/build.sh b/linux/keyman-config/build.sh index 35608c69eb7..9c0588f796b 100755 --- a/linux/keyman-config/build.sh +++ b/linux/keyman-config/build.sh @@ -46,7 +46,7 @@ execute_with_temp_schema() { TEMP_DATA_DIR=$(mktemp -d) SCHEMA_DIR="${TEMP_DATA_DIR}/glib-2.0/schemas" export XDG_DATA_DIRS="${TEMP_DATA_DIR}":${XDG_DATA_DIRS-} - export GSETTINGS_SCHEMA_DIR="${SCHEMA_DIR}" + export GSETTINGS_SCHEMA_DIR="${SCHEMA_DIR}:/usr/share/glib-2.0/schemas/:${GSETTINGS_SCHEMA_DIR-}" mkdir -p "${SCHEMA_DIR}" cp resources/com.keyman.gschema.xml "${SCHEMA_DIR}"/ glib-compile-schemas "${SCHEMA_DIR}"