From 15bee1239877a4629a245fe457f06e5f96668423 Mon Sep 17 00:00:00 2001 From: Matthew Pickering Date: Wed, 7 Dec 2022 10:50:59 +0000 Subject: hadrian: Add test:all_deps to build just testsuite dependencies Fixes #22534 --- hadrian/doc/testsuite.md | 13 +++++++++++++ hadrian/src/Rules/Test.hs | 3 +++ 2 files changed, 16 insertions(+) diff --git a/hadrian/doc/testsuite.md b/hadrian/doc/testsuite.md index 49a310d8a8..6ba289dd2b 100644 --- a/hadrian/doc/testsuite.md +++ b/hadrian/doc/testsuite.md @@ -22,6 +22,19 @@ tested in CI. If you use an untested flavour such as "Quick" then you run the risk that not all tests will pass. In particular you can rely on the `validate` and `perf` flavours being tested but no others. +## Building just the dependencies needed for the testsuite + +By default the testsuite is queried to work out what specific dependencies need to +be built for tests. For example, some linter tests don't require anything to be built. +If you wish to build all the targets for the testsuite before running any tests there is +a special meta-target which builds all the dependencies you might need when running the testsuite. + +``` +build test:all_deps +``` + + + ## Running only a subset of the testsuite ### Specific tests diff --git a/hadrian/src/Rules/Test.hs b/hadrian/src/Rules/Test.hs index 0c8bd0059d..58b689bad3 100644 --- a/hadrian/src/Rules/Test.hs +++ b/hadrian/src/Rules/Test.hs @@ -82,6 +82,9 @@ inTreeOutTree inTree outTree = do testsuiteDeps :: Rules () testsuiteDeps = do root <- buildRootRules + "test:all_deps" ~> do + need ("test:ghc" : map cp_target checkPrograms) + "test:ghc" ~> inTreeOutTree (\stg -> do needTestsuitePackages stg -- cgit v1.2.1