This repository has been archived on 2025-06-25. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
RiscV-Formal/tests/doctests.hs
2025-02-12 23:54:15 -05:00

20 lines
534 B
Haskell

module Main where
import Prelude
import Build_doctests (flags, pkgs, module_sources)
import Test.DocTest (doctest)
import System.Environment (lookupEnv)
import System.Process
getGlobalPackageDb :: IO String
getGlobalPackageDb = readProcess "ghc" ["--print-global-package-db"] ""
main :: IO ()
main = do
inNixShell <-lookupEnv "IN_NIX_SHELL"
extraFlags <-
case inNixShell of
Nothing -> pure []
Just _ -> pure . ("-package-db="++) <$> getGlobalPackageDb
doctest (flags ++ extraFlags ++ pkgs ++ module_sources)