diff options
author | Matthew Pickering <matthewtpickering@gmail.com> | 2022-01-31 19:08:01 +0000 |
---|---|---|
committer | Matthew Pickering <matthewtpickering@gmail.com> | 2022-02-04 09:38:47 +0000 |
commit | f76886edbc9b0b8feeeed95e25cb20b9035f8eaf (patch) | |
tree | 9e0fea48143276c2903c3567709f7ad6c9f9eb29 /testsuite/driver/runtests.py | |
parent | e59446c6a682587c21424e5830f305ab2f8f8cfa (diff) | |
download | haskell-wip/testsuite-linters.tar.gz |
testsuite: Run testsuite dependency calculation before GHC is builtwip/testsuite-linters
The main motivation for this patch is to allow tests to be added to the
testsuite which test things about the source tree without needing to
build GHC. In particular the notes linter can easily start failing and
by integrating it into the testsuite the process of observing these
changes is caught by normal validation procedures rather than having to
run the linter specially.
With this patch I can run
```
./hadrian/build test --flavour=devel2 --only="uniques"
```
In a clean tree to run the checkUniques linter without having to build
GHC.
Fixes #21029
Diffstat (limited to 'testsuite/driver/runtests.py')
-rw-r--r-- | testsuite/driver/runtests.py | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/testsuite/driver/runtests.py b/testsuite/driver/runtests.py index 6858715c7a..d2e25eaa19 100644 --- a/testsuite/driver/runtests.py +++ b/testsuite/driver/runtests.py @@ -275,12 +275,18 @@ def format_path(path): # On Windows we need to set $PATH to include the paths to all the DLLs # in order for the dynamic library tests to work. if windows: - pkginfo = getStdout([config.ghc_pkg, 'dump']) + try: + pkginfo = getStdout([config.ghc_pkg, 'dump']) + except FileNotFoundError as err: + # This can happen when we are only running tests which don't depend on ghc (ie linters) + # In that case we probably haven't built ghc-pkg yet so this query will fail. + print (err) + print ("Failed to call ghc-pkg for windows path modification... some tests might fail") + pkginfo = "" topdir = config.libdir - if windows: - mingw = os.path.abspath(os.path.join(topdir, '../mingw/bin')) - mingw = format_path(mingw) - ghc_env['PATH'] = os.pathsep.join([ghc_env.get("PATH", ""), mingw]) + mingw = os.path.abspath(os.path.join(topdir, '../mingw/bin')) + mingw = format_path(mingw) + ghc_env['PATH'] = os.pathsep.join([ghc_env.get("PATH", ""), mingw]) for line in pkginfo.split('\n'): if line.startswith('library-dirs:'): path = line.rstrip() |