1{-# LANGUAGE ScopedTypeVariables #-}
9import Control.Monad.Trans.Maybe
10import Control.Exception
13import System.Directory
15import System.Exit (exitFailure)
16import System.IO (stderr, hPutStrLn)
18findNodeProcess :: IO (Maybe String)
19findNodeProcess = runMaybeT . msum $ map (MaybeT . findExecutable) names
21 names = ["nodejs", "node"]
24-- Fetches code necessary to run the tests with. The resulting support code
25-- should then be checked in, so that npm/bower etc is not required to run the
28-- Simply rerun this (via ghci is probably easiest) when the support code needs
31updateSupportCode :: IO ()
33 setCurrentDirectory "tests/support"
34 if System.Info.os == "mingw32"
35 then callProcess "setup-win.cmd" []
37 callProcess "npm" ["install"]
38 -- bower uses shebang "/usr/bin/env node", but we might have nodejs
39 node <- maybe cannotFindNode pure =<< findNodeProcess
40 -- Sometimes we run as a root (e.g. in simple docker containers)
41 -- And we are non-interactive: https://github.com/bower/bower/issues/1162
42 callProcess node ["node_modules/.bin/bower", "--allow-root", "install", "--config.interactive=false"]
43 setCurrentDirectory "../.."
45 cannotFindNode :: IO a
47 hPutStrLn stderr "Cannot find node (or nodejs) executable"
51-- The support modules that should be cached between test cases, to avoid
52-- excessive rebuilding.
54supportModules :: [String]
57 , "Control.Alternative"
58 , "Control.Applicative"
60 , "Control.Biapplicative"
69 , "Control.Monad.Eff.Class"
70 , "Control.Monad.Eff.Console"
71 , "Control.Monad.Eff.Unsafe"
72 , "Control.Monad.Rec.Class"
77 , "Control.Semigroupoid"
79 , "Data.Array.Partial"
83 , "Data.Bifunctor.Clown"
84 , "Data.Bifunctor.Flip"
85 , "Data.Bifunctor.Join"
86 , "Data.Bifunctor.Joker"
87 , "Data.Bifunctor.Product"
88 , "Data.Bifunctor.Wrap"
89 , "Data.Bitraversable"
91 , "Data.BooleanAlgebra"
94 , "Data.CommutativeRing"
96 , "Data.Either.Nested"
98 , "Data.EuclideanRing"
102 , "Data.Function.Uncurried"
104 , "Data.Functor.Invariant"
107 , "Data.Generic.Rep.Eq"
108 , "Data.Generic.Rep.Monoid"
109 , "Data.Generic.Rep.Ord"
110 , "Data.Generic.Rep.Semigroup"
111 , "Data.Generic.Rep.Show"
112 , "Data.HeytingAlgebra"
118 , "Data.Monoid.Additive"
119 , "Data.Monoid.Alternate"
124 , "Data.Monoid.Multiplicative"
125 , "Data.NaturalTransformation"
136 , "Data.String.CaseInsensitive"
137 , "Data.String.Regex"
138 , "Data.String.Regex.Flags"
139 , "Data.String.Regex.Unsafe"
140 , "Data.String.Unsafe"
144 , "Data.Tuple.Nested"
152 , "Type.Data.Ordering"
160pushd :: forall a. FilePath -> IO a -> IO a
162 original <- getCurrentDirectory
163 setCurrentDirectory dir
164 result <- try act :: IO (Either IOException a)
165 setCurrentDirectory original
166 either throwIO return result
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list