diff --git a/test/default.nix b/test/default.nix index abccf8f7b3..066d3a5aad 100644 --- a/test/default.nix +++ b/test/default.nix @@ -221,6 +221,7 @@ let cabal-project-nix-path = callTest ./cabal-project-nix-path {}; plugin = callTest ./plugin {}; supported-languages = callTest ./supported-langauges {}; + js-template-haskell = callTest ./js-template-haskell {}; unit = unitTests; }; diff --git a/test/js-template-haskell/default.nix b/test/js-template-haskell/default.nix new file mode 100644 index 0000000000..03bf9c48f7 --- /dev/null +++ b/test/js-template-haskell/default.nix @@ -0,0 +1,27 @@ +# Test building TH code that needs DLLs when cross compiling for windows +{ stdenv, lib, project', haskellLib, recurseIntoAttrs, testSrc, compiler-nix-name, ... }: + +with lib; + +let + project = project' { + inherit compiler-nix-name; + src = testSrc "js-template-haskell"; + modules = [ + # Fix node: createProcess: posix_spawnp: does not exist (No such file or directory) + # ({ pkgs,... }: { + # packages.js-template-haskell.components.library.build-tools = [ pkgs.pkgsBuildHost.nodejs ]; + # }) + ]; + }; + + packages = project.hsPkgs; + +in recurseIntoAttrs { + ifdInputs = { + inherit (project) plan-nix; + }; + + build = packages.js-template-haskell.components.library; + build-profiled = packages.js-template-haskell.components.library.profiled; +} diff --git a/test/js-template-haskell/js-template-haskell.cabal b/test/js-template-haskell/js-template-haskell.cabal new file mode 100644 index 0000000000..26d6878c91 --- /dev/null +++ b/test/js-template-haskell/js-template-haskell.cabal @@ -0,0 +1,16 @@ +cabal-version: 3.0 +name: js-template-haskell +version: 0.1.0.0 +category: Repro +build-type: Simple + +common warnings + ghc-options: -Wall + +library + import: warnings + exposed-modules: MyLib + build-depends: base + , uri-bytestring + hs-source-dirs: src + default-language: Haskell2010 diff --git a/test/js-template-haskell/src/MyLib.hs b/test/js-template-haskell/src/MyLib.hs new file mode 100644 index 0000000000..564b5e992d --- /dev/null +++ b/test/js-template-haskell/src/MyLib.hs @@ -0,0 +1,8 @@ +{-# LANGUAGE QuasiQuotes #-} + +module MyLib (someFunc) where + +import URI.ByteString.QQ + +someFunc :: IO () +someFunc = putStrLn $ show [uri|https://www.example.com/|]