From a381399f880a529e9d37e53edafef5f10eccbb71 Mon Sep 17 00:00:00 2001 From: David Waern Date: Sat, 12 Apr 2008 19:00:15 +0000 Subject: Add a script for copying test output to "expected" output --- tests/copy.hs | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'tests/copy.hs') diff --git a/tests/copy.hs b/tests/copy.hs index e69de29b..d19dff7b 100644 --- a/tests/copy.hs +++ b/tests/copy.hs @@ -0,0 +1,23 @@ +import System.Cmd +import System.Environment +import System.FilePath +import System.Exit +import System.Directory +import Data.List +import Control.Monad + +main = do + args <- getArgs + dir <- getCurrentDirectory + contents <- getDirectoryContents (dir "output") + if not $ null args + then + mapM copy [ "output" file | file <- contents, ".html" `isSuffixOf` file, takeBaseName file `elem` args ] + else + mapM copy [ "output" file | file <- contents, ".html" `isSuffixOf` file ] + +copy file = do + let new = "tests" takeFileName file <.> ".ref" + print file + print new + copyFile file ("tests" takeFileName file <.> ".ref") -- cgit v1.2.3