halcanary | decb21e | 2015-12-10 07:52:45 -0800 | [diff] [blame] | 1 | #!/bin/sh |
| 2 | # Copyright 2015 Google Inc. |
| 3 | # |
| 4 | # Use of this source code is governed by a BSD-style license that can be |
| 5 | # found in the LICENSE file. |
| 6 | |
| 7 | # Parse the output of fiddle_main, for use in testing |
| 8 | while IFS= read -r line; do |
| 9 | type=$(echo $line | sed -n 's/[^"]*"\([^"]*\)":.*/\1/p') |
| 10 | if [ "$type" ]; then |
| 11 | case "$type" in |
Joe Gregorio | 97b10ac | 2017-06-01 13:24:11 -0400 | [diff] [blame] | 12 | Raster|Gpu) ext='.png';; |
| 13 | Pdf) ext='.pdf';; |
| 14 | Skp) ext='.skp';; |
| 15 | Text|GLInfo) ext='.txt';; |
halcanary | decb21e | 2015-12-10 07:52:45 -0800 | [diff] [blame] | 16 | esac |
| 17 | dst="${TMPDIR:-/tmp}/fiddle_${type}${ext}" |
| 18 | echo $line | sed 's/[^"]*"[^"]*": "//; s/"\(,\|\)$//' \ |
| 19 | | base64 -d > "$dst" |
| 20 | echo $dst |
| 21 | fi |
| 22 | done |