Copyright | © 2018-2020 IOHK |
---|---|
License | Apache-2.0 |
Safe Haskell | None |
Language | Haskell2010 |
Test.Utils.Paths
Description
Utility function for finding the package test data directory.
Synopsis
- getTestData :: Q Exp
- getTestDataPath :: FilePath -> Q Exp
- inNixBuild :: IO Bool
Documentation
getTestData :: Q Exp Source #
A TH function to get the test data directory.
It combines the current source file location and cabal file to locate the package directory in such a way that works in both the stack/cabal package build and ghci.
For the Nix build, rather than baking in a path that starts with /build
, it
makes the test data path relative to the current directory.
getTestDataPath :: FilePath -> Q Exp Source #
A variant of getTestData
which lets you specify the test data FilePath
relative to the package root directory.
inNixBuild :: IO Bool Source #
Infer from environment variables whether we are running within a Nix build (and not just a nix-shell).