From 84680dae703db9187fb076ab4065785a13206ff0 Mon Sep 17 00:00:00 2001 From: P. J. McDermott Date: Tue, 02 Oct 2012 02:58:24 -0400 Subject: Improve format of "ob_reduce_deps" test data. --- diff --git a/tests/ob_reduce_deps.data b/tests/ob_reduce_deps.data deleted file mode 100644 index 5c853d9..0000000 --- a/tests/ob_reduce_deps.data +++ /dev/null @@ -1,28 +0,0 @@ -# dependencies ; reduced dependencies ; type ; host-arch - -foo, bar ;foo, bar \ - ;n;core-linux-eglibc -foo,bar ;foo, bar \ - ;n;core-linux-eglibc -foo, bar ;foo, bar \ - ;n;core-linux-eglibc -foo, bar ;foo, bar \ - ;u;core-linux-eglibc -foo,bar ;foo, bar \ - ;u;core-linux-eglibc -foo, bar ;foo, bar \ - ;u;core-linux-eglibc - -foo | bar ;foo | bar \ - ;n;core-linux-eglibc -foo|bar ;foo | bar \ - ;n;core-linux-eglibc -foo | bar ;foo | bar \ - ;n;core-linux-eglibc - -foo [core-linux-eglibc], bar [!core-linux-eglibc] \ - ;foo \ - ;n;core-linux-eglibc -foo [core-linux-eglibc], bar [!core-linux-eglibc] \ - ;foo \ - ;u;core-linux-eglibc diff --git a/tests/ob_reduce_deps.rc b/tests/ob_reduce_deps.rc new file mode 100644 index 0000000..ff1acfc --- /dev/null +++ b/tests/ob_reduce_deps.rc @@ -0,0 +1,71 @@ +# Normal and union AND-lists. + +type='n' +host_arch='core-linux-eglibc' +deps='foo, bar' +result='foo, bar' +testcase + +type='n' +host_arch='core-linux-eglibc' +deps='foo,bar' +result='foo, bar' +testcase + +type='n' +host_arch='core-linux-eglibc' +deps='foo, bar' +result='foo, bar' +testcase + +type='u' +host_arch='core-linux-eglibc' +deps='foo, bar' +result='foo, bar' +testcase + +type='u' +host_arch='core-linux-eglibc' +deps='foo,bar' +result='foo, bar' +testcase + +type='u' +host_arch='core-linux-eglibc' +deps='foo, bar' +result='foo, bar' +testcase + +# Normal and union OR-lists. + +type='n' +host_arch='core-linux-eglibc' +deps='foo | bar' +result='foo | bar' +testcase + +type='n' +host_arch='core-linux-eglibc' +deps='foo|bar' +result='foo | bar' +testcase + +type='n' +host_arch='core-linux-eglibc' +deps='foo | bar' +result='foo | bar' +testcase + +# Normal and union AND-lists with arch specs. + +type='n' +host_arch='core-linux-eglibc' +deps='foo [core-linux-eglibc], bar [!core-linux-eglibc]' +result='foo' +testcase + +type='u' +host_arch='core-linux-eglibc' +deps='foo [core-linux-eglibc], bar [!core-linux-eglibc]' +result='foo' +testcase 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 \ - <