Skip to content

Commit

Permalink
tests: Pretty print Dict when compating for PyStats
Browse files Browse the repository at this point in the history
Change-Id: I1d93453072d12aa2dd40066f364723de1225b4e0
  • Loading branch information
BobbyRBruce committed May 20, 2024
1 parent 5c2419c commit a1c6b37
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 8 deletions.
5 changes: 3 additions & 2 deletions tests/gem5/stats/configs/pystat_scalar_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

import argparse
import json
import sys

import m5
Expand Down Expand Up @@ -99,8 +100,8 @@
print("Output statistics do not match expected:", file=sys.stderr)
print("", file=sys.stderr)
print("Expected:", file=sys.stderr)
print(expected_output, file=sys.stderr)
print(json.dumps(expected_output, indent=4), file=sys.stderr)
print("", file=sys.stderr)
print("Actual:", file=sys.stderr)
print(output, file=sys.stderr)
print(json.dumps(output, indent=4), file=sys.stderr)
sys.exit(1)
5 changes: 3 additions & 2 deletions tests/gem5/stats/configs/pystat_sparse_dist_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

import argparse
import json
import sys

import m5
Expand Down Expand Up @@ -113,8 +114,8 @@
print("Output statistics do not match expected:", file=sys.stderr)
print("", file=sys.stderr)
print("Expected:", file=sys.stderr)
print(expected_output, file=sys.stderr)
print(json.dumps(expected_output, indent=4), file=sys.stderr)
print("", file=sys.stderr)
print("Actual:", file=sys.stderr)
print(output, file=sys.stderr)
print(json.dumps(output, indent=4), file=sys.stderr)
sys.exit(1)
5 changes: 3 additions & 2 deletions tests/gem5/stats/configs/pystat_vector2d_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

import argparse
import json
import sys

import m5
Expand Down Expand Up @@ -176,8 +177,8 @@
print("Output statistics do not match expected:", file=sys.stderr)
print("", file=sys.stderr)
print("Expected:", file=sys.stderr)
print(expected_output, file=sys.stderr)
print(json.dumps(expected_output, indent=4), file=sys.stderr)
print("", file=sys.stderr)
print("Actual:", file=sys.stderr)
print(output, file=sys.stderr)
print(json.dumps(output, indent=4), file=sys.stderr)
sys.exit(1)
5 changes: 3 additions & 2 deletions tests/gem5/stats/configs/pystat_vector_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

import argparse
import json
import sys

import m5
Expand Down Expand Up @@ -139,8 +140,8 @@
print("Output statistics do not match expected:", file=sys.stderr)
print("", file=sys.stderr)
print("Expected:", file=sys.stderr)
print(expected_output, file=sys.stderr)
print(json.dumps(expected_output, indent=4), file=sys.stderr)
print("", file=sys.stderr)
print("Actual:", file=sys.stderr)
print(output, file=sys.stderr)
print(json.dumps(output, indent=4), file=sys.stderr)
sys.exit(1)

0 comments on commit a1c6b37

Please sign in to comment.