From 4a7f47138efd3dfa417caf526e384c3468b62525 Mon Sep 17 00:00:00 2001
From: Fendor <fendor@posteo.de>
Date: Thu, 23 May 2024 17:16:46 +0200
Subject: [PATCH] Improve test labels for binary interface file size tests

Test labels for binary interface file sizes are hard to read and overly
verbose at the same time. Extend the name for the metric title, but
shorten it in the actual comparison table.
---
 testsuite/driver/testutil.py |  3 +++
 testsuite/tests/iface/all.T  | 18 +++++++++---------
 2 files changed, 12 insertions(+), 9 deletions(-)

diff --git a/testsuite/driver/testutil.py b/testsuite/driver/testutil.py
index 9e0cdc5d49e6..a9f0e448958c 100644
--- a/testsuite/driver/testutil.py
+++ b/testsuite/driver/testutil.py
@@ -160,5 +160,8 @@ def shorten_metric_name(name: str) -> str:
         "compile_time/bytes allocated": "ghc/alloc",
         "compile_time/peak_megabytes_allocated": "ghc/peak",
         "compile_time/max_bytes_used": "ghc/max",
+        "binary_size/if_compression(1)": "size/1",
+        "binary_size/if_compression(2)": "size/2",
+        "binary_size/if_compression(3)": "size/3",
     }
     return dic.get(name, name)
diff --git a/testsuite/tests/iface/all.T b/testsuite/tests/iface/all.T
index b4388d541005..61da78de8ed3 100644
--- a/testsuite/tests/iface/all.T
+++ b/testsuite/tests/iface/all.T
@@ -1,23 +1,23 @@
 test( 'if_faststring'
-    , [ stat_from_file('if_compression(1)', 5, 'NORMALSIZE')
-      , stat_from_file('if_compression(2)', 5, 'MEDIUMSIZE')
-      , stat_from_file('if_compression(3)', 5, 'FULLSIZE')
+    , [ stat_from_file('binary_size/if_compression(1)', 5, 'NORMALSIZE')
+      , stat_from_file('binary_size/if_compression(2)', 5, 'MEDIUMSIZE')
+      , stat_from_file('binary_size/if_compression(3)', 5, 'FULLSIZE')
       , extra_files(["Lib.hs"])]
     , compile_and_run
     , ['-package ghc'])
 
 test( 'if_name'
-    , [ stat_from_file('if_compression(1)', 5, 'NORMALSIZE')
-      , stat_from_file('if_compression(2)', 5, 'MEDIUMSIZE')
-      , stat_from_file('if_compression(3)', 5, 'FULLSIZE')
+    , [ stat_from_file('binary_size/if_compression(1)', 5, 'NORMALSIZE')
+      , stat_from_file('binary_size/if_compression(2)', 5, 'MEDIUMSIZE')
+      , stat_from_file('binary_size/if_compression(3)', 5, 'FULLSIZE')
       , extra_files(["Lib.hs", "IfaceSharingName.hs"])]
     , compile_and_run
     , ['-package ghc'])
 
 test( 'if_ifacetype'
-    , [ stat_from_file('if_compression(1)', 5, 'NORMALSIZE')
-      , stat_from_file('if_compression(2)', 5, 'MEDIUMSIZE')
-      , stat_from_file('if_compression(3)', 5, 'FULLSIZE')
+    , [ stat_from_file('binary_size/if_compression(1)', 5, 'NORMALSIZE')
+      , stat_from_file('binary_size/if_compression(2)', 5, 'MEDIUMSIZE')
+      , stat_from_file('binary_size/if_compression(3)', 5, 'FULLSIZE')
       , extra_files(["Lib.hs", "IfaceSharingIfaceType.hs"])]
     , compile_and_run
     , ['-package ghc'])
-- 
GitLab