35 lines · bash
1#!/bin/sh2# perf list tests3# SPDX-License-Identifier: GPL-2.04 5set -e6 7shelldir=$(dirname "$0")8# shellcheck source=lib/setup_python.sh9. "${shelldir}"/lib/setup_python.sh10 11list_output=$(mktemp /tmp/__perf_test.list_output.json.XXXXX)12 13cleanup() {14 rm -f "${list_output}"15 16 trap - EXIT TERM INT17}18 19trap_cleanup() {20 cleanup21 exit 122}23trap trap_cleanup EXIT TERM INT24 25test_list_json() {26 echo "Json output test"27 perf list -j -o "${list_output}"28 $PYTHON -m json.tool "${list_output}"29 echo "Json output test [Success]"30}31 32test_list_json33cleanup34exit 035