From cffe05a60e6718c7a4f4fbc78f4471f2ce526f3a Mon Sep 17 00:00:00 2001 From: Akira TAGOH Date: Fri, 24 May 2019 11:16:31 +0000 Subject: [PATCH] Update some fixes --- .../files/run-lang-coverage-test | 19 +++++++++++++++++++ tests/roles/custom-test-fonts/tasks/main.yml | 3 ++- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/tests/roles/custom-test-fonts/files/run-lang-coverage-test b/tests/roles/custom-test-fonts/files/run-lang-coverage-test index 1c91cf6..81fefa8 100755 --- a/tests/roles/custom-test-fonts/files/run-lang-coverage-test +++ b/tests/roles/custom-test-fonts/files/run-lang-coverage-test @@ -84,6 +84,25 @@ if [ -z "$OPT_ARTIFACTS_DIR" ] || [ -z "$OPT_LANG" ] || [ -z "$OPT_PATH" ]; then exit 0 fi +expand_regex() { + local e ret=() + local path="$1" + shift + (cd $path; + for e; do + debug "$e" + set +f + local x=$(find -regextype posix-egrep -regex "./$e" -print|sed -e 's,^\./,,g') + ret+=($x) + set -f + echo ${ret[@]} + done) + echo ${ret[@]} +} + +OPT_INCLUDE=($(expand_regex $OPT_PATH ${OPT_INCLUDE[@]})) +OPT_EXCLUDE=($(expand_regex $OPT_PATH ${OPT_EXCLUDE[@]})) + debug "Path: $OPT_PATH" debug "Lang: $OPT_LANG" debug "Artifacts dir: $OPT_ARTIFACTS_DIR" diff --git a/tests/roles/custom-test-fonts/tasks/main.yml b/tests/roles/custom-test-fonts/tasks/main.yml index f4c4ce0..981d3aa 100644 --- a/tests/roles/custom-test-fonts/tasks/main.yml +++ b/tests/roles/custom-test-fonts/tasks/main.yml @@ -2,10 +2,11 @@ - block: - name: language coverage - script: run-lang-coverage-test --lang "{{ item }}" --path "{{ path_prefix }}" --artifactsdir "{{ remote_artifacts }}" {{ "" if coverage.values is not defined or coverage[item].name is not defined else "--name " + coverage[item].name }} {{ "" if coverage.values is not defined or coverage[item].exclude is not defined else "--exclude " + (coverage[item].exclude | join('--exclude ')) }} {{ "" if coverage.values is not defined or coverage[item].include is not defined else "--include " + (coverage[item].include | join('--include ')) }} + script: run-lang-coverage-test --lang "{{ item }}" --path "{{ path_prefix }}" --artifactsdir "{{ remote_artifacts }}" {{ "" if coverage.values is not defined or coverage[item].name is not defined else "--name " + coverage[item].name }} {{ "" if coverage.values is not defined or coverage[item].exclude is not defined else '--exclude "' + (coverage[item].exclude | join('" --exclude "')) + '"'}} {{ "" if coverage.values is not defined or coverage[item].include is not defined else '--include "' + (coverage[item].include | join('" --include "')) + '"'}} with_items: - "{{ coverage if coverage.keys is not defined else coverage.keys()|list }}" - name: generic family assignment + when: families is defined script: run-family-test --lang {{ item.lang }} --family '{{ item.family }}' --alias {{ item.alias }} --artifactsdir {{ remote_artifacts }} --package {{ package if item.package is not defined else item.package }} with_items: - "{{ families }}"