diff --git a/tests/cputestdata/cpu-parse.sh b/tests/cputestdata/cpu-parse.sh index cd1ab024b33cf61ac249b84b3ccf7e71e79d57c3..96ff1074e0bfe0b8a2e7423b1ef2b56f33fef261 100755 --- a/tests/cputestdata/cpu-parse.sh +++ b/tests/cputestdata/cpu-parse.sh @@ -42,7 +42,7 @@ json() while read; do $first || echo first=false - json_reformat <<<"$REPLY" | tr -s '\n' + $(dirname $0)/cpu-reformat.py <<<"$REPLY" done } diff --git a/tests/cputestdata/cpu-reformat.py b/tests/cputestdata/cpu-reformat.py new file mode 100755 index 0000000000000000000000000000000000000000..999ef1698c7febf89f6c106561945d364a8bb7db --- /dev/null +++ b/tests/cputestdata/cpu-reformat.py @@ -0,0 +1,9 @@ +#!/usr/bin/env python2 + +import sys +import json + +dec = json.JSONDecoder() +data, pos = dec.raw_decode(sys.stdin.read()) +json.dump(data, sys.stdout, indent = 2, separators = (',', ': ')) +print