Skip to content

Commit 18be956

Browse files
authored
Merge pull request #49 from input-output-hk/rvl/tests-clean
tests: Clean build directories, etc, before running
2 parents 0747270 + 2d2aacf commit 18be956

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

test/tests.sh

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ NIX_BUILD_ARGS="${NIX_BUILD_ARGS:-}"
77

88
cd $(dirname $0)
99

10+
printf "*** Cleaning package build directories..." >& 2
11+
rm -rvf */cabal.project.local */.ghc.environment* */dist */dist-newstyle */.stack-work
12+
echo >& 2
13+
1014
printf "*** Running the nix-build tests...\n" >& 2
1115
nix-build $NIX_BUILD_ARGS --no-out-link --keep-going ./default.nix
1216
echo >& 2
@@ -33,21 +37,21 @@ printf "*** Checking that a nix-shell works for cabal...\n" >& 2
3337
nix-shell $NIX_BUILD_ARGS \
3438
--pure ./default.nix \
3539
-A with-packages.test-shell \
36-
--run 'echo CABAL_CONFIG=$CABAL_CONFIG && type -p ghc && cd with-packages && rm -rf dist-newstyle .ghc-environment* && cabal new-build'
40+
--run 'echo CABAL_CONFIG=$CABAL_CONFIG && type -p ghc && cd with-packages && cabal new-build'
3741
echo >& 2
3842

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

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

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

0 commit comments

Comments
 (0)