on master help sign in
Merge pull request #95 from obsidiansystems/alexfmpe-test-project-shells

Test ghc and ghcjs shells

commit47419edbe6b3df35ff0ac981429a50ebfca23593 authorLuigy Leon <luichi.19@gmail.com> dateThu 17 May 2018, 14:26 (8 years ago) parentc24a8240330ff9
2 files changed+11
lib/selftest/src/Obelisk/SelfTest.hs+7 skeleton/backend/backend.cabal+4
lib/selftest/src/Obelisk/SelfTest.hs+7
@@ -43,6 +43,13 @@ main = do
4343 it "can build ghcjs.frontend" $ inProj $ do
4444 run "nix-build" ["--no-out-link", "-A", "ghcjs.frontend"]
4545
46+ forM_ ["ghc", "ghcjs"] $ \compiler -> do
47+ let
48+ shell = "shells." <> compiler
49+ inShell cmd = run "nix-shell" $ ["-A", fromString shell, "--run", cmd]
50+ it ("can enter " <> shell) $ inProj $ inShell "exit"
51+ it ("can build in " <> shell) $ inProj $ inShell $ "cabal new-build --" <> fromString compiler <> " all"
52+
4653 it "can use ob run" $ inProj $ handle_sh (\case ExitSuccess -> pure (); e -> throw e) $ do
4754 runHandle "ob" ["run"] $ \stdout -> do
4855 (_, firstUri) <- obRun httpManager stdout
skeleton/backend/backend.cabal+4
@@ -5,6 +5,8 @@ build-type: Simple
55
66library
77 hs-source-dirs: src
8+ if impl(ghcjs)
9+ buildable: False
810 build-depends: base
911 , common
1012 , obelisk-backend
@@ -15,6 +17,8 @@ library
1517executable backend
1618 main-is: main.hs
1719 hs-source-dirs: src
20+ if impl(ghcjs)
21+ buildable: False
1822 build-depends: base
1923 , backend
2024 , common