aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools/fiddle/parse-fiddle-output
diff options
context:
space:
mode:
authorGravatar halcanary <halcanary@google.com>2016-04-18 11:50:07 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2016-04-18 11:50:07 -0700
commitf0da138c9500bab765a6ef59d97759d1466c1965 (patch)
tree1431756e9a33d8d04048e760d66e521b7dde21c3 /tools/fiddle/parse-fiddle-output
parent382949db14cb38ffbc5b1e15a0f56bb7d4e8f7d0 (diff)
experimental/fiddle -> tools/fiddle
Diffstat (limited to 'tools/fiddle/parse-fiddle-output')
-rwxr-xr-xtools/fiddle/parse-fiddle-output21
1 files changed, 21 insertions, 0 deletions
diff --git a/tools/fiddle/parse-fiddle-output b/tools/fiddle/parse-fiddle-output
new file mode 100755
index 0000000000..f9a2fac6d6
--- /dev/null
+++ b/tools/fiddle/parse-fiddle-output
@@ -0,0 +1,21 @@
+#!/bin/sh
+# Copyright 2015 Google Inc.
+#
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+# Parse the output of fiddle_main, for use in testing
+while IFS= read -r line; do
+ type=$(echo $line | sed -n 's/[^"]*"\([^"]*\)":.*/\1/p')
+ if [ "$type" ]; then
+ case "$type" in
+ Raster|Gpu) ext='.png';;
+ Pdf) ext='.pdf';;
+ Skp) ext='.skp';;
+ esac
+ dst="${TMPDIR:-/tmp}/fiddle_${type}${ext}"
+ echo $line | sed 's/[^"]*"[^"]*": "//; s/"\(,\|\)$//' \
+ | base64 -d > "$dst"
+ echo $dst
+ fi
+done