From ed93f8450b92579dd639ae25361fa650613a5b7e Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Sat, 21 Jul 2018 11:09:14 +0200 Subject: Redo manifest parsing using bash co-process facility --- tests/manifest-parser/driver.in | 8 ++++++-- tests/manifest-parser/testscript | 2 ++ 2 files changed, 8 insertions(+), 2 deletions(-) (limited to 'tests/manifest-parser') diff --git a/tests/manifest-parser/driver.in b/tests/manifest-parser/driver.in index 90dc0e3..ffd9a64 100644 --- a/tests/manifest-parser/driver.in +++ b/tests/manifest-parser/driver.in @@ -9,7 +9,9 @@ set -o errtrace # Trap ERR in functions. @import libbutl/manifest-parser@ -while IFS=: read -r -d '' n v; do +butl_manifest_parser_start "$@" + +while IFS=: read -ru "$butl_manifest_parser_ofd" -d '' n v; do if [ -z "$n" ]; then echo "$v" else @@ -17,4 +19,6 @@ while IFS=: read -r -d '' n v; do echo "$n" echo "$v" fi -done < <(butl_parse_manifest) +done + +butl_manifest_parser_finish diff --git a/tests/manifest-parser/testscript b/tests/manifest-parser/testscript index 6a95286..154b107 100644 --- a/tests/manifest-parser/testscript +++ b/tests/manifest-parser/testscript @@ -21,3 +21,5 @@ libfoo depends libbar EOO + +#@@ TODO: test reading from file instead of stdin. -- cgit v1.1