diff options
author | Aleš Mrázek <ales.mrazek@nic.cz> | 2024-09-10 12:02:32 +0200 |
---|---|---|
committer | Aleš Mrázek <ales.mrazek@nic.cz> | 2024-09-30 11:16:07 +0200 |
commit | 28070cffafe789159cca42b5ac106bb21be66fdb (patch) | |
tree | f144ddc52d2f9605c82bde3b5874a6ee67cd5f69 /scripts | |
parent | python/knot_resolver: constants fixes (diff) | |
download | knot-resolver-28070cffafe789159cca42b5ac106bb21be66fdb.tar.xz knot-resolver-28070cffafe789159cca42b5ac106bb21be66fdb.zip |
ci: manager: configure meson before every test
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/poe-tasks/check | 2 | ||||
-rwxr-xr-x | scripts/poe-tasks/examples | 2 | ||||
-rwxr-xr-x | scripts/poe-tasks/kresctl | 2 | ||||
-rwxr-xr-x | scripts/poe-tasks/man | 2 | ||||
-rwxr-xr-x | scripts/poe-tasks/test | 2 | ||||
-rw-r--r-- | scripts/poe-tasks/utils/_env.sh | 29 |
6 files changed, 26 insertions, 13 deletions
diff --git a/scripts/poe-tasks/check b/scripts/poe-tasks/check index 9cd529e9..8e6507e4 100755 --- a/scripts/poe-tasks/check +++ b/scripts/poe-tasks/check @@ -14,6 +14,8 @@ function check_rv { aggregate_rv=$(( $aggregate_rv + $1 )) } +kres_is_meson_configured + # stop failing early, because we wouldn't do anything else than fail set +e diff --git a/scripts/poe-tasks/examples b/scripts/poe-tasks/examples index 8b0be2c4..b501ca57 100755 --- a/scripts/poe-tasks/examples +++ b/scripts/poe-tasks/examples @@ -4,6 +4,8 @@ src_dir="$(dirname "$(realpath "$0")")" source $src_dir/utils/_env.sh +kres_is_meson_configured + # validate all configuration examples for example in $PWD/etc/config/config.example.*.yaml; do diff --git a/scripts/poe-tasks/kresctl b/scripts/poe-tasks/kresctl index 50e028fc..d5662fb8 100755 --- a/scripts/poe-tasks/kresctl +++ b/scripts/poe-tasks/kresctl @@ -4,5 +4,7 @@ src_dir="$(dirname "$(realpath "$0")")" source $src_dir/utils/_env.sh +kres_is_meson_configured + # run knot-resolver client python3 -m knot_resolver.client $@ diff --git a/scripts/poe-tasks/man b/scripts/poe-tasks/man index f6986d58..60f0ae6e 100755 --- a/scripts/poe-tasks/man +++ b/scripts/poe-tasks/man @@ -4,6 +4,6 @@ src_dir="$(dirname "$(realpath "$0")")" source $src_dir/utils/_env.sh -build_knot_resolver_c +kres_meson_build man -l .install/share/man/man8/$1* diff --git a/scripts/poe-tasks/test b/scripts/poe-tasks/test index 85fd6089..79c6e3a2 100755 --- a/scripts/poe-tasks/test +++ b/scripts/poe-tasks/test @@ -4,5 +4,7 @@ src_dir="$(dirname "$(realpath "$0")")" source $src_dir/utils/_env.sh +kres_is_meson_configured + # run pytest env PYTHONPATH=. pytest --junitxml=unit.junit.xml --cov=python/knot_resolver --show-capture=all tests/manager diff --git a/scripts/poe-tasks/utils/_env.sh b/scripts/poe-tasks/utils/_env.sh index b5e0f14f..7b8fc4b3 100644 --- a/scripts/poe-tasks/utils/_env.sh +++ b/scripts/poe-tasks/utils/_env.sh @@ -73,18 +73,8 @@ function kres_meson_configure { echo } -function kres_meson_build { - if [ -d .build ]; then - echo - echo Building Knot Resolver C komponents - echo ----------------------------------- - echo -e "${blue}In case of an compilation error, run this command to try to fix it:${reset}" - echo -e "\t${blue}rm -r $install_dir $build_dir${reset}" - echo - ninja -C $build_dir - ninja install -C $build_dir - echo - else +function kres_is_meson_configured { + if [ ! -d .build ]; then echo echo Knot Resolver is not configured for building. echo "Please run './poe configure' (optionally with additional Meson arguments)". @@ -92,3 +82,18 @@ function kres_meson_build { exit 2 fi } + +function kres_meson_build { + + kres_is_meson_configured + + echo + echo Building Knot Resolver C komponents + echo ----------------------------------- + echo -e "${blue}In case of an compilation error, run this command to try to fix it:${reset}" + echo -e "\t${blue}rm -r $install_dir $build_dir${reset}" + echo + ninja -C $build_dir + ninja install -C $build_dir + echo +} |