Commit Graph

234 Commits

Author SHA1 Message Date
Daniel Gröber
2b4fd77c28 Add GHC-7.10 support 2015-02-08 12:43:35 +01:00
Daniel Gröber
9a8a3651d0 Fix findCabalFile 2014-11-03 00:45:27 +01:00
Daniel Gröber
506cf18885 Don't use fromJust 2014-11-03 00:33:23 +01:00
Rob Everest
56cc237e26 Support where clauses, let bindings and case expressions in case splitting (fixes #395) 2014-11-03 00:15:12 +01:00
Daniel Gröber
833d9ce058 $HOME/.cabal is not a cabal file 2014-11-03 00:04:15 +01:00
Daniel Gröber
37af8e368d Refactoring World, etc. and fix #387 2014-11-02 01:19:27 +01:00
Daniel Gröber
9ac128aa6f Fix #387, Pattern match failure in GhcPkg 2014-10-30 01:10:56 +01:00
Daniel Gröber
a384593bb1 Only run PatternSynonyms test with ghc>=7.8 2014-09-12 06:13:04 +02:00
Daniel Gröber
690a64f5b5 Merge branch 'master' of https://github.com/robeverest/ghc-mod
Conflicts:
	Language/Haskell/GhcMod/CabalConfig.hs
2014-09-12 05:21:12 +02:00
Rob Everest
2c2e7782d2 Use the cabal configuration flags where possible when finalizing the PackageDescription. 2014-09-12 13:15:05 +10:00
Daniel Gröber
1c8d1edb4d Workaround for #340 2014-09-12 04:02:32 +02:00
Daniel Gröber
a0ae09a3e6 Give readProcess' more sensible error messages.
Also a bunch of refactoring for GhcModError
2014-08-28 15:57:49 +02:00
Daniel Gröber
aeb11fb0b5 Keep error information in extract 2014-08-24 14:41:30 +02:00
Alan Zimmerman
0944820dba CaseSplit panic sorted. closes https://github.com/kazu-yamamoto/ghc-mod/issues/336 2014-08-23 14:06:26 +02:00
Alan Zimmerman
9101f306d1 Adding test case for https://github.com/kazu-yamamoto/ghc-mod/issues/336 2014-08-23 11:01:49 +02:00
Kazu Yamamoto
ca7b0001ed fix a test case. 2014-08-20 15:36:52 +09:00
Kazu Yamamoto
51710c38b0 trying to fix Travis CI. 2014-08-20 12:35:36 +09:00
Kazu Yamamoto
1e1505c535 removing warnings from spec. 2014-08-20 12:14:27 +09:00
Daniel Gröber
1d015019c9 Fix UtilSpec 2014-08-19 05:21:59 +02:00
Daniel Gröber
271ff4e162 Catch cabal configure failure properly 2014-08-18 08:06:36 +02:00
Daniel Gröber
fa65d7269e Add a test for gmsGet/Put 2014-08-12 18:24:39 +02:00
Daniel Gröber
9922cf08e1 Generate cabal.sandbox.config in test/data/broken-cabal 2014-08-12 18:24:39 +02:00
Daniel Gröber
87c587993a Make parseCabalFile use MonadError 2014-08-12 18:24:39 +02:00
Kazu Yamamoto
dcadd5c7ba removing warnings. 2014-08-12 16:41:21 +09:00
Kazu Yamamoto
463ab9a26f adding a test for foreign export. 2014-08-12 16:37:05 +09:00
Daniel Gröber
c69b252e3c Add failing test for runGhcModT 2014-08-11 23:48:23 +02:00
Daniel Gröber
7388b50474 Add a test making sure pattern match failures on GhcModT work the way I expect 2014-08-06 20:42:34 +02:00
Daniel Gröber
24633f04e4 Remove ghc-mod.cache files before tests run 2014-08-06 19:38:42 +02:00
Daniel Gröber
f311efd90c Rework GhcModT monad stack 2014-08-06 19:38:42 +02:00
Kazu Yamamoto
e1d9c3b881 clean up lookupSymbol. 2014-07-18 15:13:30 +09:00
Daniel Gröber
c3b959a8e5 Add FindSpec 2014-07-17 16:16:12 +02:00
Daniel Gröber
15e288decf Remove some redundant stuff from test suite 2014-07-17 15:53:04 +02:00
Kazu Yamamoto
3050ba1863 fixing tests. 2014-07-15 21:40:22 +09:00
Daniel Gröber
0a62ad9116 Fix doctest 2014-07-15 01:04:06 +02:00
Daniel Gröber
f0bfcb8811 Use GhcModT everywhere and remove the GhcMod alias
Not doing this makes having GhcModT pretty pointless as users of the
library wouldn't be able to use custom inner monads as evey function for
dealing with GhcModT's would be constraint to (GhcModT IO) thus only
allowing IO as the inner monad.
2014-07-15 01:03:56 +02:00
Daniel Gröber
81c58585a2 Add functions for dealing with packages, modules and bindings to GHCApi 2014-07-11 10:43:51 +02:00
Daniel Gröber
4b6a687bc1 Migrate the remaining parts of the exposed API to GhcMod a 2014-07-11 03:13:38 +02:00
Daniel Gröber
eff77d1f31 Add test for sandbox compatibility with ghc < 7.8 2014-05-19 01:29:49 +02:00
Daniel Gröber
241c7946fc Revert "Fix tests for Cabal <= 1.16"
The problem the reverted commit tried to fix seems to have been just a
symptom of another root cause that was later fixed as the problem does
not seem to occur anymore even without this changeset also this
changeset broke cabal sandboxes with ghc < 7.8.

Fix #262

This reverts commit 8741323f5b.

Conflicts:
	Language/Haskell/GhcMod/GhcPkg.hs
2014-05-19 01:27:35 +02:00
Daniel Gröber
80e2761f2f Ghc->GhcMod: finish Browse, Check 2014-05-14 18:05:40 +02:00
Daniel Gröber
f1535efcf2 Ghc -> GhcMod: Browse, Check 2014-05-14 17:06:29 +02:00
Kohei Suzuki
bcd2dfcffc Add test for no errors case 2014-05-11 00:30:02 +09:00
Daniel Gröber
f949e4be7a Copy ComponentLocalBuildInfo from Cabal-1.18
This way `configDependencies` works even when the Cabal version used by
cabal-install is later than the one used by ghc-mod.
2014-05-10 02:04:09 +02:00
Daniel Gröber
44b897c6a5 Print useful information when running spec 2014-05-09 20:37:55 +02:00
Daniel Gröber
8741323f5b Fix tests for Cabal <= 1.16 2014-05-09 20:37:15 +02:00
Daniel Gröber
b8f9498f83 Fix reading of older Cabal setup-configs 2014-05-09 20:35:13 +02:00
Kazu Yamamoto
8561e7b656 To break cyclic import, this patch makes GhcPkg.hs independent from Monad.hs(refactoring for #244)
This removes `ghcPkgList`, `ghcPkgListEx` and `ghcPkgDbOpt`. I'm not sure
this is a right way to do.
2014-05-08 12:42:45 +09:00
Daniel Gröber
81504de8bd spec: Be more forgiving for ghc opts in getCompilerOptions 2014-05-05 09:26:56 +02:00
Daniel Gröber
635830b527 Fix #242, ghcPkgList(Ex) on NixOS 2014-05-05 00:29:10 +02:00
Daniel Gröber
f750d10a9a Cabal needs empty 00-index.cache and 00-index.tar in sanxbox 2014-05-03 15:38:27 +02:00
Daniel Gröber
96a54d2148 Remove test/*/setup-config before spec 2014-05-03 15:38:27 +02:00
Daniel Gröber
2839d6b557 Add UtilsSpec 2014-05-03 15:36:10 +02:00
Daniel Gröber
92d0eec2bc Fix failing test 2014-05-03 15:36:10 +02:00
Daniel Gröber
0c859294a3 Parse cabal setup-config to get depencencies 2014-05-03 15:36:10 +02:00
Daniel Gröber
82d1d6b982 Add cabal file to duplicate-pkgver test data
It's not really valid but enough to make ghc-mod happy, without it
findCradle doesn't work properly and without the empty `library`
sections it crashes even.
2014-05-03 15:35:04 +02:00
Daniel Gröber
759a6efab1 Add some test data
..for testing behaviour with multiple versions/ids of packges being
available
2014-05-03 15:35:04 +02:00
Daniel Gröber
ee0135aac2 Correct check-packageid/cabal.sandbox.config.in 2014-05-03 15:35:04 +02:00
Daniel Gröber
0206085662 Generate ghc package.cache before running spec 2014-05-03 15:35:04 +02:00
Kazu Yamamoto
17b80ccc2f doctest includes macro. 2014-04-24 23:11:55 +09:00
Daniel Gröber
1639a7b2e0 Bring spec up to speed 2014-04-18 04:00:01 +02:00
Daniel Gröber
bb438feb83 User ghc's cProjectVersionInt to get version information 2014-04-16 01:57:52 +02:00
Daniel Gröber
7d75787ae3 Only add available package to ghc options
Fixes #185
2014-04-15 05:18:42 +02:00
Daniel Gröber
30b8366526 Refactor the way packages databases are handled
- cradle now stores a list of active package databases instead of only
  the user store (if present).

- rename `cradlePackageDb` -> `cradlePkgDbStack` as that`s what the ghc
  documentaion calls this kind of thing

- `getPackageDbPackages` now returns names of all visible packages in
  the given directory. Also the implementation now uses `ghc-pkg`
  instead of manually looking at the package database
2014-04-15 05:15:50 +02:00
Kazu Yamamoto
e9859980ab info/type does not require module name.
Fallback was removed. See #199.
2014-04-11 11:51:25 +09:00
Kazu Yamamoto
3bfbbb8b5c supporting sandbox only (without cabal) to fix #164. 2014-03-30 17:28:57 +09:00
Kazu Yamamoto
955b1b4091 user package db options for both GHC and ghc-pkg. 2014-03-28 12:05:11 +09:00
Kazu Yamamoto
a4ce3a5650 fixing test. 2014-03-26 14:49:37 +09:00
Kazu Yamamoto
16e050439d removing fast/slow code. 2014-03-17 15:56:00 +09:00
Kazu Yamamoto
9c30b11667 typo. 2014-03-13 09:34:45 +09:00
Naohiro Aota
04022ab0ac Add test to check package id extraction
This commit add a failing test to check extracting package id. The test will
fail with the following output for now:

1) Cradle.getPackageDbPackages find a config file and extracts packages with their ids
expected: [("template-haskell",Just "template-haskell-2.8.0.0-32d4f24abdbb6bf41272b183b2e23e9c")]
 but got: []
2014-01-30 21:18:45 +09:00
Naohiro Aota
a0db24b0a5 Extend Package to include id
This commit
1. rename Package with PackageBaseName
2. Pacakge = (PackageBaseName, Maybe String) to save its id
3. Expose packages with id if available
2014-01-30 20:45:30 +09:00
Kohei Suzuki
f9c9ac676c Work around canonicalizePath "/" in GHC 7.2.2 2014-01-14 15:24:10 +09:00
Sergey Khorev
429cdfa83b Try loading a module if findModule failed for it 2013-11-20 08:57:45 +04:00
Kazu Yamamoto
2c9b4227dd Trying to resolve Travis fails. 2013-10-07 16:39:54 +09:00
Kohei Suzuki
b0f20ffb04 Support GHC < 7.6.0 which doesn't have getExecutablePath 2013-10-05 12:19:30 +09:00
Kohei Suzuki
9469058d58 Fix builded ghc-mod's path for cabal-sandbox environment 2013-10-05 12:08:17 +09:00
Kohei Suzuki
136e09e704 ghc-mod browse should take care of sandboxes 2013-09-27 12:25:41 +09:00
Kohei Suzuki
67166a4d75 ghc-mod list should take care of sandboxes 2013-09-27 12:23:53 +09:00
Kazu Yamamoto
ecd4bd665d removing unnecesary code. 2013-09-21 18:45:17 +09:00
Kazu Yamamoto
a94b1a3b5a fixing tests. 2013-09-21 18:37:33 +09:00
Kazu Yamamoto
1050ea3c63 more tests. 2013-09-21 15:32:22 +09:00
Kazu Yamamoto
c78d708c1c Introducing strict getPackageDbDir. 2013-09-21 15:10:43 +09:00
Kazu Yamamoto
6bbe9e5df9 add doctest. 2013-09-20 21:10:31 +09:00
Kazu Yamamoto
5f0fcd0442 getCompilerOptions handles package-db options. 2013-09-20 17:15:41 +09:00
Kazu Yamamoto
4cfc702b79 removing unnecessary test cases. 2013-09-20 15:57:26 +09:00
Kazu Yamamoto
49791fb6ea Supporting sandbox sharing.
Braking backword compatibility of findCradle.
2013-09-20 15:48:50 +09:00
Kazu Yamamoto
a491927ef6 more tests. 2013-09-20 11:22:56 +09:00
Kazu Yamamoto
b514eebfc2 typo. 2013-09-20 10:48:51 +09:00
Kazu Yamamoto
b75d96b50a fixing tests. 2013-09-16 10:16:33 +09:00
Kazu Yamamoto
d37e1592d4 test for Cabal 1.18.0. 2013-09-05 16:47:52 +09:00
Niklas Hambüchen
4758a6043c check + expand: Allow passing in multiple files 2013-09-03 20:01:47 +09:00
Niklas Hambüchen
41de7a54a2 Fix warning 2013-09-03 19:57:26 +09:00
Kazu Yamamoto
955223a2a8 module name change. 2013-09-03 11:49:35 +09:00
Kazu Yamamoto
1b862ca107 removing shouldContain since hspec provides it! 2013-09-03 11:44:59 +09:00
Kazu Yamamoto
3bbc008907 test update and error handling in CabalApi. 2013-05-30 10:50:19 +09:00
Kazu Yamamoto
089d490607 writing docs. 2013-05-20 14:28:56 +09:00
Kazu Yamamoto
849c308e5c Separating IO and Ghc. 2013-05-20 11:29:44 +09:00
Kazu Yamamoto
56b1e14219 test case for #118. 2013-05-08 16:47:57 +09:00
Kazu Yamamoto
ee0cfcc7ce fixing a test. 2013-05-08 16:34:34 +09:00
eagletmt
4b77af102b Add a test case for checking QuasiQuotes module 2013-04-01 15:55:29 +09:00
Kazu Yamamoto
0535270fa8 removing unnecesary spaces. 2013-04-01 14:19:15 +09:00
mvoidex
6be2b8f56e Fixed tests on Windows 2013-03-31 18:12:34 +04:00
mvoidex
653912a066 Test for no fail on unicode output 2013-03-31 17:55:37 +04:00
Kazu Yamamoto
b87a1e0e39 a test case for info. 2013-03-30 21:24:57 +09:00
Kazu Yamamoto
4a5f5441f3 Fixing a bug of TH expansion for GHC 7.6 (#92). 2013-03-16 11:50:45 +09:00
eagletmt
24ada2abeb Gather all hs-source-dirs to check test modules in sub-directories 2013-03-15 17:40:06 +09:00
eagletmt
aaf137df9f Add test cases for type and info about TH check 2013-03-14 23:25:38 +09:00
Kazu Yamamoto
0556ec330c test for fast (not TH). 2013-03-13 13:37:17 +09:00
Kazu Yamamoto
9e54c8c87b brushing up tests. 2013-03-13 12:48:26 +09:00
Kazu Yamamoto
6102c2d1b6 adding a test file. 2013-03-07 21:00:48 +09:00
Kazu Yamamoto
1a792c4943 pkgConf is a directory. 2013-03-07 20:50:04 +09:00
Kazu Yamamoto
a7b41d34f9 adding pkgconf. 2013-03-05 11:00:56 +09:00
Kazu Yamamoto
2a13e9b243 error test for Cradle. 2013-03-05 10:49:32 +09:00
Kazu Yamamoto
39954d9114 relative dir for testing. 2013-03-05 10:44:17 +09:00
Kazu Yamamoto
89dc02f185 test for Cradle. 2013-03-05 10:22:33 +09:00
Kazu Yamamoto
1047c76906 refactoring for testing. 2013-03-04 18:11:09 +09:00
Kazu Yamamoto
a393f8a971 Using Cradle. 2013-03-02 16:14:55 +09:00
eagletmt
80676966b9 Show types of data constructors with "browse -d" 2013-03-01 22:16:11 +09:00
Kazu Yamamoto
9a6c960d53 Checking TH to see if "-fno-code" can be used. 2013-03-01 21:17:52 +09:00
Kazu Yamamoto
7761691795 Refactoring Cabal stuff. 2013-03-01 15:25:43 +09:00
Kazu Yamamoto
a8e57615ba Making cabalBuildInfo pure. 2013-03-01 13:14:46 +09:00
Kazu Yamamoto
431e3fa904 Making cabalDependPackages pure. 2013-03-01 12:21:42 +09:00
Kazu Yamamoto
4d9a170e50 Adding a test case for Browse. 2013-03-01 09:46:17 +09:00
Kazu Yamamoto
7ee8843a52 removing unnecessary files. 2013-02-15 10:39:40 +09:00
Kazu Yamamoto
6752a8edcf test for Info. 2013-02-13 16:22:07 +09:00
Kazu Yamamoto
e3f09cd476 "Warning: "(a space after :) for GHC 7.6. 2013-02-13 16:04:22 +09:00
Kazu Yamamoto
a05e4e817d test for Cabal where exec depends on its lib and its fix code. 2013-02-13 15:29:24 +09:00
Kazu Yamamoto
c63f04a926 proper test for gitDirs. 2013-02-13 14:30:15 +09:00
Kazu Yamamoto
5b2ddde59e test for Cabal and CabalApi. 2013-02-12 16:24:33 +09:00
Kazu Yamamoto
23045b5312 test for Lint. 2013-02-12 14:31:01 +09:00
Kazu Yamamoto
42a1ea0a87 test for Browse. 2013-02-12 14:18:19 +09:00
Kazu Yamamoto
fb7e509efc test for Flag. 2013-02-12 14:12:15 +09:00
Kazu Yamamoto
a8b199ab70 more proper name. 2013-02-12 14:09:42 +09:00
Kazu Yamamoto
418c39b759 adding tests. 2013-02-12 14:06:22 +09:00