summaryrefslogtreecommitdiffstats
path: root/tests/ob_reduce_deps.sh
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ob_reduce_deps.sh')
-rw-r--r--tests/ob_reduce_deps.sh37
1 files changed, 17 insertions, 20 deletions
diff --git a/tests/ob_reduce_deps.sh b/tests/ob_reduce_deps.sh
index 28d69e6..3f2afd7 100644
--- a/tests/ob_reduce_deps.sh
+++ b/tests/ob_reduce_deps.sh
@@ -22,36 +22,33 @@
ob_use deps
ret=0
+type=
+host_arch=
+deps=
+result=
-while read line; do
+main()
+{
+ . ./ob_reduce_deps.rc
- line="${line%%#*}"
- [ -z "${line}" ] && continue
-
- IFS=';' read -r test_deps good_deps type host_arch \
- <<EOF
-${line}
-EOF
-
- test_deps="$(echo "${test_deps}" | sed 's/^ *//;s/ *$//')"
- good_deps="$(echo "${good_deps}" | sed 's/^ *//;s/ *$//')"
- type="$(echo "${type}" | sed 's/^ *//;s/ *$//')"
- host_arch="$(echo "${host_arch}" | sed 's/^ *//;s/ *$//')"
+ exit ${ret}
+}
+testcase()
+{
if [ "${type}" != 'u' ]; then
- test_deps="$(ob_reduce_deps -a "${host_arch}" "${test_deps}")"
+ deps="$(ob_reduce_deps -a "${host_arch}" "${deps}")"
else
- test_deps="$(ob_reduce_deps -u -a "${host_arch}" "${test_deps}")"
+ deps="$(ob_reduce_deps -u -a "${host_arch}" "${deps}")"
fi
- if [ "${test_deps}" != "${good_deps}" ]; then
+ if [ "${deps}" != "${result}" ]; then
printf 'Dependency list of type "%s" for host arch "%s":\n' \
"${type}" "${host_arch}"
printf ' "%s" != "%s"\n' \
- "${test_deps}" "${good_deps}"
+ "${deps}" "${result}"
ret=1
fi
+}
-done <'ob_reduce_deps.data'
-
-exit ${ret}
+main "${@}"