Skip to content

Commit

Permalink
Add config file back for tests
Browse files Browse the repository at this point in the history
  • Loading branch information
cbclemmer committed Apr 29, 2023
1 parent 51d670b commit 64d22f5
Show file tree
Hide file tree
Showing 5 changed files with 497 additions and 54 deletions.
50 changes: 0 additions & 50 deletions .vscode/tasks.json

This file was deleted.

8 changes: 4 additions & 4 deletions cabal-install/tests/IntegrationTests2.hs
Original file line number Diff line number Diff line change
Expand Up @@ -1941,15 +1941,15 @@ testNixFlags = do
Nothing @=? (fromFlag . globalNix . fromJust $ nixDefaultFlags)

-- Config file options
defaultConfig <- createDefaultConfigFile verbosity [] (basedir </> "nix-config/default-config")
defaultConfig <- createDefaultConfigFile verbosity [] (basedir </> "config/default-config")
trueConfig <- loadConfig verbosity (Flag (basedir </> "nix-config/nix-true"))
falseConfig <- loadConfig verbosity (Flag (basedir </> "nix-config/nix-false"))

Nothing @=? (fromFlag . globalNix . savedGlobalFlags $ defaultConfig)
Just True @=? (fromFlag . globalNix . savedGlobalFlags $ trueConfig)
Just False @=? (fromFlag . globalNix . savedGlobalFlags $ falseConfig)

defaultConfigFile <- readFile (basedir </> "nix-config/default-config")
defaultConfigFile <- readFile (basedir </> "config/default-config")
True @=? isInfixOf "-- nix:\n" defaultConfigFile

where
Expand All @@ -1962,8 +1962,8 @@ testNixFlags = do

testDefaultFlags :: Assertion
testDefaultFlags = do
_ <- createDefaultConfigFile verbosity [] (basedir </> "nix-config/default-config")
defaultConfigFile <- readFile (basedir </> "nix-config/default-config")
_ <- createDefaultConfigFile verbosity [] (basedir </> "config/default-config")
defaultConfigFile <- readFile (basedir </> "config/default-config")

True @=? testComment "default-user-config" defaultConfigFile
True @=? testComment "cabal-file" defaultConfigFile
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ haddock
-- index-location:
-- base-url:
-- lib:
-- output-dir:

init
-- interactive: False
Expand Down
246 changes: 246 additions & 0 deletions tests/IntegrationTests2/config/default-config
Original file line number Diff line number Diff line change
@@ -0,0 +1,246 @@
-- This is the configuration file for the 'cabal' command line tool.
--
-- The available configuration options are listed below.
-- Some of them have default values listed.
--
-- Lines (like this one) beginning with '--' are comments.
-- Be careful with spaces and indentation because they are
-- used to indicate layout for nested sections.
--
-- This config file was generated using the following versions
-- of Cabal and cabal-install:
-- Cabal library version: 3.11.0.0
-- cabal-install version: 3.11


repository hackage.haskell.org
url: http://hackage.haskell.org/
-- secure: True
-- root-keys:
-- key-threshold: 3

-- ignore-expiry: False
-- http-transport:
-- nix:
-- store-dir:
-- active-repositories:
-- local-no-index-repo:
remote-repo-cache: /home/colton/.cabal/packages
-- logs-dir: /home/colton/.cabal/logs
-- default-user-config:
-- verbose: 1
-- compiler: ghc
-- cabal-file:
-- with-compiler:
-- with-hc-pkg:
-- program-prefix:
-- program-suffix:
-- library-vanilla: True
-- library-profiling:
-- shared:
-- static:
-- executable-dynamic: False
-- executable-static: False
-- profiling:
-- executable-profiling:
-- profiling-detail:
-- library-profiling-detail:
-- optimization: True
-- debug-info: False
-- build-info:
-- library-for-ghci:
-- split-sections: False
-- split-objs: False
-- executable-stripping:
-- library-stripping:
-- configure-option:
-- user-install: True
-- package-db:
-- flags:
-- extra-include-dirs:
-- deterministic:
-- cid:
-- extra-lib-dirs:
-- extra-lib-dirs-static:
-- extra-framework-dirs:
extra-prog-path: /home/colton/.cabal/bin
-- instantiate-with:
-- tests: False
-- coverage: False
-- library-coverage:
-- exact-configuration: False
-- benchmarks: False
-- relocatable: False
-- response-files:
-- allow-depending-on-private-libs:
-- cabal-lib-version:
-- append:
-- backup:
-- constraint:
-- preference:
-- solver: modular
-- allow-older: False
-- allow-newer: False
-- write-ghc-environment-files:
-- documentation: False
-- doc-index-file: $datadir/doc/$arch-$os-$compiler/index.html
-- only-download: False
-- target-package-db:
-- max-backjumps: 4000
-- reorder-goals: False
-- count-conflicts: True
-- fine-grained-conflicts: True
-- minimize-conflict-set: False
-- independent-goals: False
-- prefer-oldest: False
-- shadow-installed-packages: False
-- strong-flags: False
-- allow-boot-library-installs: False
-- reject-unconstrained-dependencies: none
-- reinstall: False
-- avoid-reinstalls: False
-- force-reinstalls: False
-- upgrade-dependencies: False
-- index-state:
-- root-cmd:
-- symlink-bindir:
build-summary: /home/colton/.cabal/logs/build.log
-- build-log:
remote-build-reporting: none
-- report-planning-failure: False
-- per-component: True
-- run-tests:
jobs: $ncpus
-- keep-going: False
-- offline: False
-- lib: False
-- package-env:
-- overwrite-policy:
-- install-method:
installdir: /home/colton/.cabal/bin
-- username:
-- password:
-- password-command:
-- builddir:

haddock
-- keep-temp-files: False
-- hoogle: False
-- html: False
-- html-location:
-- executables: False
-- tests: False
-- benchmarks: False
-- foreign-libraries: False
-- all:
-- internal: False
-- css:
-- hyperlink-source: False
-- quickjump: False
-- hscolour-css:
-- contents-location:
-- index-location:
-- base-url:
-- lib:
-- output-dir:

init
-- interactive: False
-- quiet: False
-- no-comments: False
-- minimal: False
-- cabal-version: 3.0
-- license:
-- extra-doc-file:
-- tests:
-- test-dir:
-- simple: False
-- language: Haskell2010
-- application-dir: app
-- source-dir: src

install-dirs user
-- prefix: /home/colton/.cabal
-- bindir: $prefix/bin
-- libdir: $prefix/lib
-- libsubdir: $abi/$libname
-- dynlibdir: $libdir/$abi
-- libexecdir: $prefix/libexec
-- libexecsubdir: $abi/$pkgid
-- datadir: $prefix/share
-- datasubdir: $abi/$pkgid
-- docdir: $datadir/doc/$abi/$pkgid
-- htmldir: $docdir/html
-- haddockdir: $htmldir
-- sysconfdir: $prefix/etc

install-dirs global
-- prefix: /usr/local
-- bindir: $prefix/bin
-- libdir: $prefix/lib
-- libsubdir: $abi/$libname
-- dynlibdir: $libdir/$abi
-- libexecdir: $prefix/libexec
-- libexecsubdir: $abi/$pkgid
-- datadir: $prefix/share
-- datasubdir: $abi/$pkgid
-- docdir: $datadir/doc/$abi/$pkgid
-- htmldir: $docdir/html
-- haddockdir: $htmldir
-- sysconfdir: $prefix/etc

program-locations
-- alex-location:
-- ar-location:
-- c2hs-location:
-- cpphs-location:
-- doctest-location:
-- gcc-location:
-- ghc-location:
-- ghc-pkg-location:
-- ghcjs-location:
-- ghcjs-pkg-location:
-- greencard-location:
-- haddock-location:
-- happy-location:
-- haskell-suite-location:
-- haskell-suite-pkg-location:
-- hmake-location:
-- hpc-location:
-- hsc2hs-location:
-- hscolour-location:
-- jhc-location:
-- ld-location:
-- pkg-config-location:
-- runghc-location:
-- strip-location:
-- tar-location:
-- uhc-location:

program-default-options
-- alex-options:
-- ar-options:
-- c2hs-options:
-- cpphs-options:
-- doctest-options:
-- gcc-options:
-- ghc-options:
-- ghc-pkg-options:
-- ghcjs-options:
-- ghcjs-pkg-options:
-- greencard-options:
-- haddock-options:
-- happy-options:
-- haskell-suite-options:
-- haskell-suite-pkg-options:
-- hmake-options:
-- hpc-options:
-- hsc2hs-options:
-- hscolour-options:
-- jhc-options:
-- ld-options:
-- pkg-config-options:
-- runghc-options:
-- strip-options:
-- tar-options:
-- uhc-options:
Loading

0 comments on commit 64d22f5

Please sign in to comment.