Skip to content

tests: Clean build directories, etc, before running #49

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
Feb 12, 2019
Merged
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
10 changes: 7 additions & 3 deletions test/tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ NIX_BUILD_ARGS="${NIX_BUILD_ARGS:-}"

cd $(dirname $0)

printf "*** Cleaning package build directories..." >& 2
rm -rvf */cabal.project.local */.ghc.environment* */dist */dist-newstyle */.stack-work
echo >& 2

printf "*** Running the nix-build tests...\n" >& 2
nix-build $NIX_BUILD_ARGS --no-out-link --keep-going ./default.nix
echo >& 2
Expand All @@ -33,21 +37,21 @@ printf "*** Checking that a nix-shell works for cabal...\n" >& 2
nix-shell $NIX_BUILD_ARGS \
--pure ./default.nix \
-A with-packages.test-shell \
--run 'echo CABAL_CONFIG=$CABAL_CONFIG && type -p ghc && cd with-packages && rm -rf dist-newstyle .ghc-environment* && cabal new-build'
--run 'echo CABAL_CONFIG=$CABAL_CONFIG && type -p ghc && cd with-packages && cabal new-build'
echo >& 2

printf "*** Checking that a nix-shell works for cabal (doExactConfig component)...\n" >& 2
nix-shell $NIX_BUILD_ARGS \
--pure ./default.nix \
-A with-packages.test-shell-dec \
--run 'echo CABAL_CONFIG=$CABAL_CONFIG && echo GHC_ENVIRONMENT=$GHC_ENVIRONMENT && cd with-packages && rm -rf dist-newstyle .ghc-environment* && cabal new-build'
--run 'echo CABAL_CONFIG=$CABAL_CONFIG && echo GHC_ENVIRONMENT=$GHC_ENVIRONMENT && cd with-packages && cabal new-build'
echo >& 2

printf "*** Checking that a nix-shell works for a multi-target project...\n" >& 2
nix-shell $NIX_BUILD_ARGS \
--pure ./default.nix \
-A cabal-simple.test-shell \
--run 'cd cabal-simple && rm -rf dist-newstyle .ghc-environment* && cabal new-build'
--run 'cd cabal-simple && cabal new-build'
echo >& 2

printf "\n*** Finished successfully\n" >& 2