jw-pkg/test/integration/jw_pkg/projects/pkg-requires/test.sh

46 lines
1.6 KiB
Shell
Raw Normal View History

#!/bin/bash
# shellcheck disable=SC2048,SC2086
# Unquoted $* is intentional — the jw-pkg command line
export LC_ALL="C"
set -euo pipefail
jw_pkg_py="$*"
# Print a header and run a command whose output is part of the expected
# result. Under `set -e` a non-zero exit aborts the test.
run()
{
local log_cmd
# shellcheck disable=SC2001
log_cmd=$(echo "$*" | sed 's|.*python3[0-9.]*\s\+\(\.\.\/\)*scripts/||')
printf '============= Running: %s\n' "$log_cmd"
"$@"
}
# The topdir (-t ./proj/excl-never) and the projects root (-p ./proj) are
# part of the test command line (see the Makefile); the last -t wins over
# the global one. excl-never lists the platform name "centos" in [build]
# exclude and is therefore not excluded from the build here; excl-all is
# excluded on every platform.
# -- the platform name in [build] exclude must not be treated as a project;
# -- the excluded jw dependency is not reported
run $jw_pkg_py projects pkg-requires \
--quote --skip-excluded --hide-self --syntax names-only --delimiter " " \
run excl-never
# -- without --skip-excluded, the excluded jw dependency is reported
run $jw_pkg_py projects pkg-requires \
--quote --hide-self --syntax names-only --delimiter " " \
run excl-never
# -- an excluded seed is neither considered nor output
run $jw_pkg_py projects pkg-requires \
--quote --skip-excluded --hide-self --syntax names-only --delimiter " " \
run excl-all
# -- without --skip-excluded, the excluded seed's dependencies are reported
run $jw_pkg_py projects pkg-requires \
--quote --hide-self --syntax names-only --delimiter " " \
run excl-all