Skip to content

Fix test/tests.sh for other ghc versions #1719

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 29, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion build.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
let
haskellNix = (import ./default.nix {});
in
{ nixpkgs ? haskellNix.sources.nixpkgs-2205
{ nixpkgs ? haskellNix.sources.nixpkgs-unstable
, nixpkgsArgs ? haskellNix.nixpkgsArgs
, pkgs ? import nixpkgs nixpkgsArgs
, evalPackages ? import nixpkgs nixpkgsArgs
Expand Down
13 changes: 8 additions & 5 deletions test/tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -107,11 +107,14 @@ if [ "$TESTS" == "multi-target" ] || [ "$TESTS" == "all" ]; then
echo >& 2
fi

# These tests still use manually generated `pkgs`. They were left that way
# so that we would still be testing that workflow.
SHELL_FOR_GHC="ghc8107"
if [ "$TESTS" == "shellFor-single-package" ] || [ "$TESTS" == "all" ]; then
printf "*** Checking shellFor works for a cabal project, multiple packages...\n" >& 2
nix-shell $NIX_BUILD_ARGS \
--pure ./default.nix \
--argstr compiler-nix-name $GHC \
--argstr compiler-nix-name $SHELL_FOR_GHC \
-A shell-for.env \
--run 'cd shell-for && cabal new-build all'
echo >& 2
Expand All @@ -121,7 +124,7 @@ if [ "$TESTS" == "shellFor-multiple-package" ] || [ "$TESTS" == "all" ]; then
printf "*** Checking shellFor works for a cabal project, single package...\n" >& 2
nix-shell $NIX_BUILD_ARGS \
--pure ./default.nix \
--argstr compiler-nix-name $GHC \
--argstr compiler-nix-name $SHELL_FOR_GHC \
-A shell-for.envPkga \
--run 'cd shell-for && cabal new-build --project=single.project all'
echo >& 2
Expand All @@ -131,17 +134,17 @@ if [ "$TESTS" == "shellFor-hoogle" ] || [ "$TESTS" == "all" ]; then
printf "*** Checking shellFor has a working hoogle index...\n" >& 2
nix-shell $NIX_BUILD_ARGS \
--pure ./default.nix \
--argstr compiler-nix-name $GHC \
--argstr compiler-nix-name $SHELL_FOR_GHC \
-A shell-for.env \
--run 'hoogle ConduitT | grep Data.Conduit'
echo >& 2
fi

if [ "$TESTS" == "shellFor-not-depends" ] || [ "$TESTS" == "all" ]; then
printf "*** Checking shellFor does not depend on given packages...\n" >& 2
drva=$(nix-instantiate ./default.nix --argstr compiler-nix-name $GHC -A shell-for.env)
drva=$(nix-instantiate ./default.nix --argstr compiler-nix-name $SHELL_FOR_GHC -A shell-for.env)
echo "-- hello" >> shell-for/pkga/PkgA.hs
drvb=$(nix-instantiate ./default.nix --argstr compiler-nix-name $GHC -A shell-for.env)
drvb=$(nix-instantiate ./default.nix --argstr compiler-nix-name $SHELL_FOR_GHC -A shell-for.env)
sed -i -e '/-- hello/d' shell-for/pkga/PkgA.hs
if [ "$drva" != "$drvb" ]; then
printf "FAIL\nShell derivations\n$drva\n$drvb\n are not identical.\n" >& 2
Expand Down