diff --git a/arbtt.cabal b/arbtt.cabal
--- a/arbtt.cabal
+++ b/arbtt.cabal
@@ -1,5 +1,5 @@
 name:               arbtt
-version:            0.9.0.9
+version:            0.9.0.10
 license:            GPL
 license-file:       LICENSE
 category:           Desktop
@@ -42,7 +42,7 @@
     build-depends:
                 base >= 4.7 && < 4.10,
                 filepath, directory, transformers, utf8-string,
-                aeson >= 0.6  && < 0.12,
+                aeson >= 0.6  && < 1.1,
                 binary >= 0.5,
                 bytestring, deepseq
 
@@ -105,7 +105,7 @@
         binary >= 0.5,
         deepseq, bytestring, utf8-string, strict,
         transformers, directory, filepath,
-        aeson >= 0.6  && < 0.12,
+        aeson >= 0.6  && < 1.1,
         array == 0.4.* || == 0.5.*,
         terminal-progress-bar,
         bytestring-progress
@@ -122,6 +122,8 @@
         Data
         Data.MyText
         Data.Binary.StringRef
+        DumpFormat
+        LeftFold
         CommonStartup
         Categorize
         TimeLog
@@ -145,7 +147,7 @@
         base >= 4.7 && < 4.10,
         parsec == 3.*,
         containers == 0.5.*,
-        aeson >= 0.6  && < 0.12,
+        aeson >= 0.6  && < 1.1,
         array == 0.4.* || == 0.5.*,
         binary >= 0.5,
         deepseq, bytestring, utf8-string, strict,
@@ -248,6 +250,14 @@
     src
   Main-is:
     test.hs
+  other-modules:
+    Categorize
+    Data
+    Data.Binary.StringRef
+    Data.MyText
+    Text.Parsec.ExprFail
+    Text.Regex.PCRE.Light.Text
+    TimeLog
   Build-depends:
       base >= 4.7 && < 4.10
       , tasty >= 0.7 && < 0.12
diff --git a/tests/test.hs b/tests/test.hs
--- a/tests/test.hs
+++ b/tests/test.hs
@@ -11,6 +11,7 @@
 import Data.Typeable
 import System.Exit
 import System.Environment
+import Data.Maybe
 
 import Categorize
 import TimeLog
@@ -19,10 +20,11 @@
 
 main = do
     setEnv "TZ" "UTC" -- to make tests reproducible
-    defaultMain tests
+    distDir <- fromMaybe "dist" `liftM` lookupEnv "HASKELL_DIST_DIR"
+    defaultMain (tests distDir)
 
-tests :: TestTree
-tests = testGroup "Tests" [goldenTests, regressionTests]
+tests :: FilePath -> TestTree
+tests distDir = testGroup "Tests" [goldenTests distDir, regressionTests]
 
 regressionTests :: TestTree
 regressionTests = testGroup "Regression tests"
@@ -50,30 +52,30 @@
     ]
 
 
-goldenTests :: TestTree
-goldenTests = testGroup "Golden tests"
+goldenTests :: FilePath -> TestTree
+goldenTests distDir = testGroup "Golden tests"
     [ goldenVsString "dump small"
         "tests/small_dump.out" $
-        run "dist/build/arbtt-dump/arbtt-dump" ["-f","tests/small.log", "-t", "Show"] B.empty
+        run (distDir ++ "/build/arbtt-dump/arbtt-dump") ["-f","tests/small.log", "-t", "Show"] B.empty
     , goldenVsFile "import small"
         "tests/small_import.out" "tests/small_import.out.actual" $ void $
         B.readFile "tests/small_import.in" >>=
-        run "dist/build/arbtt-import/arbtt-import" ["-f","tests/small_import.out.actual"]
+        run (distDir ++ "/build/arbtt-import/arbtt-import") ["-f","tests/small_import.out.actual"]
     , goldenVsFile "recover small"
         "tests/small_borked_recover.out" "tests/small_borked_recover.out.actual" $ void $
-        run "dist/build/arbtt-recover/arbtt-recover" ["-i","tests/small_borked_recover.out", "-o", "tests/small_borked_recover.out.actual"] B.empty
+        run (distDir ++ "/build/arbtt-recover/arbtt-recover") ["-i","tests/small_borked_recover.out", "-o", "tests/small_borked_recover.out.actual"] B.empty
     , goldenVsString "stats small"
         "tests/small_stats.out" $
-        run "dist/build/arbtt-stats/arbtt-stats" ["--logfile", "tests/small.log", "--categorize", "tests/small.cfg"] B.empty
+        run (distDir ++ "/build/arbtt-stats/arbtt-stats") ["--logfile", "tests/small.log", "--categorize", "tests/small.cfg"] B.empty
     , goldenVsString "stats small csv"
         "tests/small_stats_csv.out" $
-        run "dist/build/arbtt-stats/arbtt-stats" ["--logfile", "tests/small.log", "--categorize", "tests/small.cfg", "--output-format", "csv"] B.empty
+        run (distDir ++ "/build/arbtt-stats/arbtt-stats") ["--logfile", "tests/small.log", "--categorize", "tests/small.cfg", "--output-format", "csv"] B.empty
     , goldenVsString "stats small unicode"
         "tests/unicode_stats.out" $
-        run "dist/build/arbtt-stats/arbtt-stats" ["--logfile", "tests/unicode.log", "--categorize", "tests/unicode.cfg"] B.empty
+        run (distDir ++ "/build/arbtt-stats/arbtt-stats") ["--logfile", "tests/unicode.log", "--categorize", "tests/unicode.cfg"] B.empty
     , goldenVsString "stats gap handling"
         "tests/gap-handling.out" $
-        run "dist/build/arbtt-stats/arbtt-stats" ["--logfile", "tests/gap-handling.log", "--categorize", "tests/gap-handling.cfg", "--intervals", "Program:"] B.empty
+        run (distDir ++ "/build/arbtt-stats/arbtt-stats") ["--logfile", "tests/gap-handling.log", "--categorize", "tests/gap-handling.cfg", "--intervals", "Program:"] B.empty
     ]
 
 
