[FFmpeg-devel] [PATCH v2 7/8] fate: run command and get logs rungetavlogs() allows to get avlog messages

Nicolas Gaullier nicolas.gaullier at arkena.com
Mon Feb 12 11:48:29 EET 2018


From: nicolas gaullier <nicolas.gaullier at arkena.com>

---
 tests/fate-run.sh | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/tests/fate-run.sh b/tests/fate-run.sh
index 05f4ca5e20..0f28af5858 100755
--- a/tests/fate-run.sh
+++ b/tests/fate-run.sh
@@ -84,6 +84,20 @@ runecho(){
     $target_exec $target_path/"$@" >&3
 }
 
+# $1=regex $2..$n=command
+# catch av_log messages
+rungetavlogs(){
+    test "${V:-0}" -gt 0 && echo "$target_exec" $target_path/"${@:2}" >&3
+    $target_exec $target_path/"${@:2}" 3>&2 2>&1 1>&3|awk -F' ' "{
+        if (/${@:1:1}/) {
+            for(i=4; i<=NF; ++i)
+                printf \$i FS
+            print \"\"
+        } else {
+            print > \"/dev/stderr\"}
+        }"
+}
+
 probefmt(){
     run ffprobe${PROGSUF} -show_entries format=format_name -print_format default=nw=1:nk=1 -v 0 "$@"
 }
-- 
2.14.1.windows.1



More information about the ffmpeg-devel mailing list