Skip to content
Snippets Groups Projects
Commit 222e3c20 authored by kristenk's avatar kristenk
Browse files

Test that 'cabal user-config init' uses CABAL_CONFIG.

parent 7c4fe9ef
No related branches found
No related tags found
No related merge requests found
......@@ -66,6 +66,8 @@ Extra-Source-Files:
tests/IntegrationTests/user-config/should_run/overwrites_with_f.sh
tests/IntegrationTests/user-config/should_run/runs_without_error.out
tests/IntegrationTests/user-config/should_run/runs_without_error.sh
tests/IntegrationTests/user-config/should_run/uses_CABAL_CONFIG.out
tests/IntegrationTests/user-config/should_run/uses_CABAL_CONFIG.sh
source-repository head
type: git
......
......@@ -264,7 +264,9 @@ main = do
-- Set up environment variables for test scripts
setEnv "GHC_PKG" $ programPath ghcPkg
setEnv "CABAL" $ programPath cabal
-- Define default arguments
setEnv "CABAL_ARGS" $ "--config-file=config-file"
setEnv "CABAL_ARGS_NO_CONFIG_FILE" " "
-- Discover all the test caregories
categories <- discoverTestCategories baseDirectory
-- Discover tests in each category
......
# Helper to run Cabal
cabal() {
$CABAL $CABAL_ARGS "$@"
$CABAL $CABAL_ARGS_NO_CONFIG_FILE "$@"
}
die() {
......
Writing default configuration to ./my-config
. ../common.sh
export CABAL_CONFIG=./my-config
cabal user-config init || die "Couldn't create config file"
test -e ./my-config || die "Config file doesn't exist"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment