testsuite: Improve output from tests which have failing pre_cmd

Closed Matthew Pickering requested to merge wip/t22329 into master

There are two changes:

  • If a pre_cmd fails, then don't attempt to run the test.
  • If a pre_cmd fails, then print the stdout and stderr from running that command (which hopefully has a nice error message).

For example:

=====> 1 of 1 [0, 0, 0]
*** framework failure for test-defaulting-plugin(normal) pre_cmd failed: 2
** pre_cmd was "$MAKE -s --no-print-directory -C defaulting-plugin package.test-defaulting-plugin TOP={top}".
DefaultLifted.hs:19:13: error: [GHC-76037]
    Not in scope: type constructor or class ‘Typ’
    Suggested fix:
      Perhaps use one of these:
        ‘Type’ (imported from GHC.Tc.Utils.TcType),
        data constructor ‘Type’ (imported from GHC.Plugins)
19 | instance Eq Typ where
   |             ^^^
make: *** [Makefile:17: package.test-defaulting-plugin] Error 1

Performance Metrics (test environment: local):

Fixes #22329 (closed)

Merge request reports