disable doctests conditionally

This commit is contained in:
2026-08-24 05:06:01 -06:00
parent c9eb8f6f85
commit 99d9e460fc
7 changed files with 39 additions and 54 deletions
+9 -3
View File
@@ -1,10 +1,16 @@
{-# LANGUAGE DoAndIfThenElse #-}
module Main where
#ifndef GYEHOEK_NO_DOCTEST
import Test.DocTest (mainFromCabal)
import System.Environment (getArgs, lookupEnv)
#endif
import System.Environment (getArgs)
import System.IO (stderr, hPutStrLn)
main :: IO ()
main = mainFromCabal "gyehoek" =<< getArgs
main =
#ifndef GYEHOEK_NO_DOCTEST
mainFromCabal "gyehoek" =<< getArgs
#else
hPutStrLn stderr "skipping doctests due to broken nix environment."
#endif