aboutsummaryrefslogtreecommitdiff
path: root/tests/Tests/Old.hs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/Tests/Old.hs')
-rw-r--r--tests/Tests/Old.hs10
1 files changed, 6 insertions, 4 deletions
diff --git a/tests/Tests/Old.hs b/tests/Tests/Old.hs
index 01e4403fb..a16784889 100644
--- a/tests/Tests/Old.hs
+++ b/tests/Tests/Old.hs
@@ -3,7 +3,7 @@ module Tests.Old (tests) where
import Test.Framework (testGroup, Test )
import Test.Framework.Providers.HUnit
import Test.HUnit ( assertBool )
-
+import System.Environment ( getArgs )
import System.IO ( openTempFile, stderr )
import System.Process ( runProcess, waitForProcess )
import System.FilePath ( (</>), (<.>) )
@@ -22,9 +22,6 @@ import Text.Printf
readFileUTF8 :: FilePath -> IO String
readFileUTF8 f = B.readFile f >>= return . toStringLazy
-pandocPath :: FilePath
-pandocPath = ".." </> "dist" </> "build" </> "pandoc" </> "pandoc"
-
data TestResult = TestPassed
| TestError ExitCode
| TestFailed String FilePath [Diff String]
@@ -209,6 +206,11 @@ testWithNormalize :: (String -> String) -- ^ Normalize function for output
-> FilePath -- ^ Norm (for test results) filepath
-> Test
testWithNormalize normalizer testname opts inp norm = testCase testname $ do
+ args <- getArgs
+ let buildDir = case args of
+ (x:_) -> ".." </> x
+ _ -> error "test-pandoc: missing buildDir argument"
+ let pandocPath = buildDir </> "pandoc" </> "pandoc"
(outputPath, hOut) <- openTempFile "" "pandoc-test"
let inpPath = inp
let normPath = norm