| 1 | |
| 2 | |
| 3 | |
| 4 |
|
| 5 | set -e
|
| 6 |
|
| 7 | shelldir=$(dirname "$0")
|
| 8 | |
| 9 | . "${shelldir}"/lib/setup_python.sh
|
| 10 |
|
| 11 | list_output=$(mktemp /tmp/__perf_test.list_output.json.XXXXX)
|
| 12 |
|
| 13 | cleanup() {
|
| 14 | rm -f "${list_output}"
|
| 15 |
|
| 16 | trap - EXIT TERM INT
|
| 17 | }
|
| 18 |
|
| 19 | trap_cleanup() {
|
| 20 | cleanup
|
| 21 | exit 1
|
| 22 | }
|
| 23 | trap trap_cleanup EXIT TERM INT
|
| 24 |
|
| 25 | test_list_json() {
|
| 26 | echo "Json output test"
|
| 27 | |
| 28 | perf list -j -o "${list_output}"
|
| 29 | |
| 30 | |
| 31 | $PYTHON -m json.tool "${list_output}" /dev/null
|
| 32 | echo "Json output test [Success]"
|
| 33 | }
|
| 34 |
|
| 35 | test_list_json
|
| 36 | cleanup
|
| 37 | exit 0
|